
obj/user/ls.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 a9 02 00 00       	call   8002da <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <ls1>:
		panic("error reading directory %s: %e", path, n);
}

void
ls1(const char *prefix, bool isdir, off_t size, const char *name)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	56                   	push   %esi
  80003b:	53                   	push   %ebx
  80003c:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80003f:	8b 75 0c             	mov    0xc(%ebp),%esi
	const char *sep;

	if(flag['l'])
  800042:	83 3d d0 41 80 00 00 	cmpl   $0x0,0x8041d0
  800049:	74 20                	je     80006b <ls1+0x38>
		printf("%11d %c ", size, isdir ? 'd' : '-');
  80004b:	89 f0                	mov    %esi,%eax
  80004d:	3c 01                	cmp    $0x1,%al
  80004f:	19 c0                	sbb    %eax,%eax
  800051:	83 e0 c9             	and    $0xffffffc9,%eax
  800054:	83 c0 64             	add    $0x64,%eax
  800057:	83 ec 04             	sub    $0x4,%esp
  80005a:	50                   	push   %eax
  80005b:	ff 75 10             	pushl  0x10(%ebp)
  80005e:	68 e2 23 80 00       	push   $0x8023e2
  800063:	e8 aa 1a 00 00       	call   801b12 <printf>
  800068:	83 c4 10             	add    $0x10,%esp
	if(prefix) {
  80006b:	85 db                	test   %ebx,%ebx
  80006d:	74 1c                	je     80008b <ls1+0x58>
		if (prefix[0] && prefix[strlen(prefix)-1] != '/')
			sep = "/";
		else
			sep = "";
  80006f:	b8 48 24 80 00       	mov    $0x802448,%eax
		if (prefix[0] && prefix[strlen(prefix)-1] != '/')
  800074:	80 3b 00             	cmpb   $0x0,(%ebx)
  800077:	75 4b                	jne    8000c4 <ls1+0x91>
		printf("%s%s", prefix, sep);
  800079:	83 ec 04             	sub    $0x4,%esp
  80007c:	50                   	push   %eax
  80007d:	53                   	push   %ebx
  80007e:	68 eb 23 80 00       	push   $0x8023eb
  800083:	e8 8a 1a 00 00       	call   801b12 <printf>
  800088:	83 c4 10             	add    $0x10,%esp
	}
	printf("%s", name);
  80008b:	83 ec 08             	sub    $0x8,%esp
  80008e:	ff 75 14             	pushl  0x14(%ebp)
  800091:	68 71 28 80 00       	push   $0x802871
  800096:	e8 77 1a 00 00       	call   801b12 <printf>
	if(flag['F'] && isdir)
  80009b:	83 c4 10             	add    $0x10,%esp
  80009e:	83 3d 38 41 80 00 00 	cmpl   $0x0,0x804138
  8000a5:	74 06                	je     8000ad <ls1+0x7a>
  8000a7:	89 f0                	mov    %esi,%eax
  8000a9:	84 c0                	test   %al,%al
  8000ab:	75 37                	jne    8000e4 <ls1+0xb1>
		printf("/");
	printf("\n");
  8000ad:	83 ec 0c             	sub    $0xc,%esp
  8000b0:	68 47 24 80 00       	push   $0x802447
  8000b5:	e8 58 1a 00 00       	call   801b12 <printf>
}
  8000ba:	83 c4 10             	add    $0x10,%esp
  8000bd:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8000c0:	5b                   	pop    %ebx
  8000c1:	5e                   	pop    %esi
  8000c2:	5d                   	pop    %ebp
  8000c3:	c3                   	ret    
		if (prefix[0] && prefix[strlen(prefix)-1] != '/')
  8000c4:	83 ec 0c             	sub    $0xc,%esp
  8000c7:	53                   	push   %ebx
  8000c8:	e8 fc 08 00 00       	call   8009c9 <strlen>
  8000cd:	83 c4 10             	add    $0x10,%esp
			sep = "";
  8000d0:	80 7c 03 ff 2f       	cmpb   $0x2f,-0x1(%ebx,%eax,1)
  8000d5:	b8 e0 23 80 00       	mov    $0x8023e0,%eax
  8000da:	ba 48 24 80 00       	mov    $0x802448,%edx
  8000df:	0f 44 c2             	cmove  %edx,%eax
  8000e2:	eb 95                	jmp    800079 <ls1+0x46>
		printf("/");
  8000e4:	83 ec 0c             	sub    $0xc,%esp
  8000e7:	68 e0 23 80 00       	push   $0x8023e0
  8000ec:	e8 21 1a 00 00       	call   801b12 <printf>
  8000f1:	83 c4 10             	add    $0x10,%esp
  8000f4:	eb b7                	jmp    8000ad <ls1+0x7a>

008000f6 <lsdir>:
{
  8000f6:	f3 0f 1e fb          	endbr32 
  8000fa:	55                   	push   %ebp
  8000fb:	89 e5                	mov    %esp,%ebp
  8000fd:	57                   	push   %edi
  8000fe:	56                   	push   %esi
  8000ff:	53                   	push   %ebx
  800100:	81 ec 14 01 00 00    	sub    $0x114,%esp
  800106:	8b 7d 08             	mov    0x8(%ebp),%edi
	if ((fd = open(path, O_RDONLY)) < 0)
  800109:	6a 00                	push   $0x0
  80010b:	57                   	push   %edi
  80010c:	e8 4a 18 00 00       	call   80195b <open>
  800111:	89 c3                	mov    %eax,%ebx
  800113:	83 c4 10             	add    $0x10,%esp
  800116:	85 c0                	test   %eax,%eax
  800118:	78 4a                	js     800164 <lsdir+0x6e>
	while ((n = readn(fd, &f, sizeof f)) == sizeof f)
  80011a:	8d b5 e8 fe ff ff    	lea    -0x118(%ebp),%esi
  800120:	83 ec 04             	sub    $0x4,%esp
  800123:	68 00 01 00 00       	push   $0x100
  800128:	56                   	push   %esi
  800129:	53                   	push   %ebx
  80012a:	e8 22 14 00 00       	call   801551 <readn>
  80012f:	83 c4 10             	add    $0x10,%esp
  800132:	3d 00 01 00 00       	cmp    $0x100,%eax
  800137:	75 41                	jne    80017a <lsdir+0x84>
		if (f.f_name[0])
  800139:	80 bd e8 fe ff ff 00 	cmpb   $0x0,-0x118(%ebp)
  800140:	74 de                	je     800120 <lsdir+0x2a>
			ls1(prefix, f.f_type==FTYPE_DIR, f.f_size, f.f_name);
  800142:	56                   	push   %esi
  800143:	ff b5 68 ff ff ff    	pushl  -0x98(%ebp)
  800149:	83 bd 6c ff ff ff 01 	cmpl   $0x1,-0x94(%ebp)
  800150:	0f 94 c0             	sete   %al
  800153:	0f b6 c0             	movzbl %al,%eax
  800156:	50                   	push   %eax
  800157:	ff 75 0c             	pushl  0xc(%ebp)
  80015a:	e8 d4 fe ff ff       	call   800033 <ls1>
  80015f:	83 c4 10             	add    $0x10,%esp
  800162:	eb bc                	jmp    800120 <lsdir+0x2a>
		panic("open %s: %e", path, fd);
  800164:	83 ec 0c             	sub    $0xc,%esp
  800167:	50                   	push   %eax
  800168:	57                   	push   %edi
  800169:	68 f0 23 80 00       	push   $0x8023f0
  80016e:	6a 1d                	push   $0x1d
  800170:	68 fc 23 80 00       	push   $0x8023fc
  800175:	e8 d2 01 00 00       	call   80034c <_panic>
	if (n > 0)
  80017a:	85 c0                	test   %eax,%eax
  80017c:	7f 0a                	jg     800188 <lsdir+0x92>
	if (n < 0)
  80017e:	78 1a                	js     80019a <lsdir+0xa4>
}
  800180:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800183:	5b                   	pop    %ebx
  800184:	5e                   	pop    %esi
  800185:	5f                   	pop    %edi
  800186:	5d                   	pop    %ebp
  800187:	c3                   	ret    
		panic("short read in directory %s", path);
  800188:	57                   	push   %edi
  800189:	68 06 24 80 00       	push   $0x802406
  80018e:	6a 22                	push   $0x22
  800190:	68 fc 23 80 00       	push   $0x8023fc
  800195:	e8 b2 01 00 00       	call   80034c <_panic>
		panic("error reading directory %s: %e", path, n);
  80019a:	83 ec 0c             	sub    $0xc,%esp
  80019d:	50                   	push   %eax
  80019e:	57                   	push   %edi
  80019f:	68 4c 24 80 00       	push   $0x80244c
  8001a4:	6a 24                	push   $0x24
  8001a6:	68 fc 23 80 00       	push   $0x8023fc
  8001ab:	e8 9c 01 00 00       	call   80034c <_panic>

008001b0 <ls>:
{
  8001b0:	f3 0f 1e fb          	endbr32 
  8001b4:	55                   	push   %ebp
  8001b5:	89 e5                	mov    %esp,%ebp
  8001b7:	53                   	push   %ebx
  8001b8:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
  8001be:	8b 5d 08             	mov    0x8(%ebp),%ebx
	if ((r = stat(path, &st)) < 0)
  8001c1:	8d 85 6c ff ff ff    	lea    -0x94(%ebp),%eax
  8001c7:	50                   	push   %eax
  8001c8:	53                   	push   %ebx
  8001c9:	e8 7c 15 00 00       	call   80174a <stat>
  8001ce:	83 c4 10             	add    $0x10,%esp
  8001d1:	85 c0                	test   %eax,%eax
  8001d3:	78 2c                	js     800201 <ls+0x51>
	if (st.st_isdir && !flag['d'])
  8001d5:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8001d8:	85 c0                	test   %eax,%eax
  8001da:	74 09                	je     8001e5 <ls+0x35>
  8001dc:	83 3d b0 41 80 00 00 	cmpl   $0x0,0x8041b0
  8001e3:	74 32                	je     800217 <ls+0x67>
		ls1(0, st.st_isdir, st.st_size, path);
  8001e5:	53                   	push   %ebx
  8001e6:	ff 75 ec             	pushl  -0x14(%ebp)
  8001e9:	85 c0                	test   %eax,%eax
  8001eb:	0f 95 c0             	setne  %al
  8001ee:	0f b6 c0             	movzbl %al,%eax
  8001f1:	50                   	push   %eax
  8001f2:	6a 00                	push   $0x0
  8001f4:	e8 3a fe ff ff       	call   800033 <ls1>
  8001f9:	83 c4 10             	add    $0x10,%esp
}
  8001fc:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8001ff:	c9                   	leave  
  800200:	c3                   	ret    
		panic("stat %s: %e", path, r);
  800201:	83 ec 0c             	sub    $0xc,%esp
  800204:	50                   	push   %eax
  800205:	53                   	push   %ebx
  800206:	68 21 24 80 00       	push   $0x802421
  80020b:	6a 0f                	push   $0xf
  80020d:	68 fc 23 80 00       	push   $0x8023fc
  800212:	e8 35 01 00 00       	call   80034c <_panic>
		lsdir(path, prefix);
  800217:	83 ec 08             	sub    $0x8,%esp
  80021a:	ff 75 0c             	pushl  0xc(%ebp)
  80021d:	53                   	push   %ebx
  80021e:	e8 d3 fe ff ff       	call   8000f6 <lsdir>
  800223:	83 c4 10             	add    $0x10,%esp
  800226:	eb d4                	jmp    8001fc <ls+0x4c>

00800228 <usage>:

void
usage(void)
{
  800228:	f3 0f 1e fb          	endbr32 
  80022c:	55                   	push   %ebp
  80022d:	89 e5                	mov    %esp,%ebp
  80022f:	83 ec 14             	sub    $0x14,%esp
	printf("usage: ls [-dFl] [file...]\n");
  800232:	68 2d 24 80 00       	push   $0x80242d
  800237:	e8 d6 18 00 00       	call   801b12 <printf>
	exit();
  80023c:	e8 ed 00 00 00       	call   80032e <exit>
}
  800241:	83 c4 10             	add    $0x10,%esp
  800244:	c9                   	leave  
  800245:	c3                   	ret    

00800246 <umain>:

void
umain(int argc, char **argv)
{
  800246:	f3 0f 1e fb          	endbr32 
  80024a:	55                   	push   %ebp
  80024b:	89 e5                	mov    %esp,%ebp
  80024d:	56                   	push   %esi
  80024e:	53                   	push   %ebx
  80024f:	83 ec 14             	sub    $0x14,%esp
  800252:	8b 75 0c             	mov    0xc(%ebp),%esi
	int i;
	struct Argstate args;

	argstart(&argc, argv, &args);
  800255:	8d 45 e8             	lea    -0x18(%ebp),%eax
  800258:	50                   	push   %eax
  800259:	56                   	push   %esi
  80025a:	8d 45 08             	lea    0x8(%ebp),%eax
  80025d:	50                   	push   %eax
  80025e:	e8 fc 0d 00 00       	call   80105f <argstart>
	while ((i = argnext(&args)) >= 0)
  800263:	83 c4 10             	add    $0x10,%esp
  800266:	8d 5d e8             	lea    -0x18(%ebp),%ebx
  800269:	eb 08                	jmp    800273 <umain+0x2d>
		switch (i) {
		case 'd':
		case 'F':
		case 'l':
			flag[i]++;
  80026b:	83 04 85 20 40 80 00 	addl   $0x1,0x804020(,%eax,4)
  800272:	01 
	while ((i = argnext(&args)) >= 0)
  800273:	83 ec 0c             	sub    $0xc,%esp
  800276:	53                   	push   %ebx
  800277:	e8 17 0e 00 00       	call   801093 <argnext>
  80027c:	83 c4 10             	add    $0x10,%esp
  80027f:	85 c0                	test   %eax,%eax
  800281:	78 16                	js     800299 <umain+0x53>
		switch (i) {
  800283:	89 c2                	mov    %eax,%edx
  800285:	83 e2 f7             	and    $0xfffffff7,%edx
  800288:	83 fa 64             	cmp    $0x64,%edx
  80028b:	74 de                	je     80026b <umain+0x25>
  80028d:	83 f8 46             	cmp    $0x46,%eax
  800290:	74 d9                	je     80026b <umain+0x25>
			break;
		default:
			usage();
  800292:	e8 91 ff ff ff       	call   800228 <usage>
  800297:	eb da                	jmp    800273 <umain+0x2d>
		}

	if (argc == 1)
		ls("/", "");
	else {
		for (i = 1; i < argc; i++)
  800299:	bb 01 00 00 00       	mov    $0x1,%ebx
	if (argc == 1)
  80029e:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
  8002a2:	75 2a                	jne    8002ce <umain+0x88>
		ls("/", "");
  8002a4:	83 ec 08             	sub    $0x8,%esp
  8002a7:	68 48 24 80 00       	push   $0x802448
  8002ac:	68 e0 23 80 00       	push   $0x8023e0
  8002b1:	e8 fa fe ff ff       	call   8001b0 <ls>
  8002b6:	83 c4 10             	add    $0x10,%esp
  8002b9:	eb 18                	jmp    8002d3 <umain+0x8d>
			ls(argv[i], argv[i]);
  8002bb:	8b 04 9e             	mov    (%esi,%ebx,4),%eax
  8002be:	83 ec 08             	sub    $0x8,%esp
  8002c1:	50                   	push   %eax
  8002c2:	50                   	push   %eax
  8002c3:	e8 e8 fe ff ff       	call   8001b0 <ls>
		for (i = 1; i < argc; i++)
  8002c8:	83 c3 01             	add    $0x1,%ebx
  8002cb:	83 c4 10             	add    $0x10,%esp
  8002ce:	39 5d 08             	cmp    %ebx,0x8(%ebp)
  8002d1:	7f e8                	jg     8002bb <umain+0x75>
	}
}
  8002d3:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8002d6:	5b                   	pop    %ebx
  8002d7:	5e                   	pop    %esi
  8002d8:	5d                   	pop    %ebp
  8002d9:	c3                   	ret    

008002da <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  8002da:	f3 0f 1e fb          	endbr32 
  8002de:	55                   	push   %ebp
  8002df:	89 e5                	mov    %esp,%ebp
  8002e1:	56                   	push   %esi
  8002e2:	53                   	push   %ebx
  8002e3:	8b 5d 08             	mov    0x8(%ebp),%ebx
  8002e6:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  8002e9:	c7 05 20 44 80 00 00 	movl   $0x0,0x804420
  8002f0:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  8002f3:	e8 10 0b 00 00       	call   800e08 <sys_getenvid>
  8002f8:	25 ff 03 00 00       	and    $0x3ff,%eax
  8002fd:	6b c0 7c             	imul   $0x7c,%eax,%eax
  800300:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  800305:	a3 20 44 80 00       	mov    %eax,0x804420

	// save the name of the program so that panic() can use it
	if (argc > 0)
  80030a:	85 db                	test   %ebx,%ebx
  80030c:	7e 07                	jle    800315 <libmain+0x3b>
		binaryname = argv[0];
  80030e:	8b 06                	mov    (%esi),%eax
  800310:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  800315:	83 ec 08             	sub    $0x8,%esp
  800318:	56                   	push   %esi
  800319:	53                   	push   %ebx
  80031a:	e8 27 ff ff ff       	call   800246 <umain>

	// exit gracefully
	exit();
  80031f:	e8 0a 00 00 00       	call   80032e <exit>
}
  800324:	83 c4 10             	add    $0x10,%esp
  800327:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80032a:	5b                   	pop    %ebx
  80032b:	5e                   	pop    %esi
  80032c:	5d                   	pop    %ebp
  80032d:	c3                   	ret    

0080032e <exit>:

#include <inc/lib.h>

void
exit(void)
{
  80032e:	f3 0f 1e fb          	endbr32 
  800332:	55                   	push   %ebp
  800333:	89 e5                	mov    %esp,%ebp
  800335:	83 ec 08             	sub    $0x8,%esp
	close_all();
  800338:	e8 70 10 00 00       	call   8013ad <close_all>
	sys_env_destroy(0);
  80033d:	83 ec 0c             	sub    $0xc,%esp
  800340:	6a 00                	push   $0x0
  800342:	e8 7c 0a 00 00       	call   800dc3 <sys_env_destroy>
}
  800347:	83 c4 10             	add    $0x10,%esp
  80034a:	c9                   	leave  
  80034b:	c3                   	ret    

0080034c <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  80034c:	f3 0f 1e fb          	endbr32 
  800350:	55                   	push   %ebp
  800351:	89 e5                	mov    %esp,%ebp
  800353:	56                   	push   %esi
  800354:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  800355:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  800358:	8b 35 00 30 80 00    	mov    0x803000,%esi
  80035e:	e8 a5 0a 00 00       	call   800e08 <sys_getenvid>
  800363:	83 ec 0c             	sub    $0xc,%esp
  800366:	ff 75 0c             	pushl  0xc(%ebp)
  800369:	ff 75 08             	pushl  0x8(%ebp)
  80036c:	56                   	push   %esi
  80036d:	50                   	push   %eax
  80036e:	68 78 24 80 00       	push   $0x802478
  800373:	e8 bb 00 00 00       	call   800433 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  800378:	83 c4 18             	add    $0x18,%esp
  80037b:	53                   	push   %ebx
  80037c:	ff 75 10             	pushl  0x10(%ebp)
  80037f:	e8 5a 00 00 00       	call   8003de <vcprintf>
	cprintf("\n");
  800384:	c7 04 24 47 24 80 00 	movl   $0x802447,(%esp)
  80038b:	e8 a3 00 00 00       	call   800433 <cprintf>
  800390:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  800393:	cc                   	int3   
  800394:	eb fd                	jmp    800393 <_panic+0x47>

00800396 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  800396:	f3 0f 1e fb          	endbr32 
  80039a:	55                   	push   %ebp
  80039b:	89 e5                	mov    %esp,%ebp
  80039d:	53                   	push   %ebx
  80039e:	83 ec 04             	sub    $0x4,%esp
  8003a1:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  8003a4:	8b 13                	mov    (%ebx),%edx
  8003a6:	8d 42 01             	lea    0x1(%edx),%eax
  8003a9:	89 03                	mov    %eax,(%ebx)
  8003ab:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8003ae:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  8003b2:	3d ff 00 00 00       	cmp    $0xff,%eax
  8003b7:	74 09                	je     8003c2 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  8003b9:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  8003bd:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8003c0:	c9                   	leave  
  8003c1:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  8003c2:	83 ec 08             	sub    $0x8,%esp
  8003c5:	68 ff 00 00 00       	push   $0xff
  8003ca:	8d 43 08             	lea    0x8(%ebx),%eax
  8003cd:	50                   	push   %eax
  8003ce:	e8 ab 09 00 00       	call   800d7e <sys_cputs>
		b->idx = 0;
  8003d3:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  8003d9:	83 c4 10             	add    $0x10,%esp
  8003dc:	eb db                	jmp    8003b9 <putch+0x23>

008003de <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  8003de:	f3 0f 1e fb          	endbr32 
  8003e2:	55                   	push   %ebp
  8003e3:	89 e5                	mov    %esp,%ebp
  8003e5:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  8003eb:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  8003f2:	00 00 00 
	b.cnt = 0;
  8003f5:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  8003fc:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  8003ff:	ff 75 0c             	pushl  0xc(%ebp)
  800402:	ff 75 08             	pushl  0x8(%ebp)
  800405:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  80040b:	50                   	push   %eax
  80040c:	68 96 03 80 00       	push   $0x800396
  800411:	e8 20 01 00 00       	call   800536 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800416:	83 c4 08             	add    $0x8,%esp
  800419:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  80041f:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  800425:	50                   	push   %eax
  800426:	e8 53 09 00 00       	call   800d7e <sys_cputs>

	return b.cnt;
}
  80042b:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  800431:	c9                   	leave  
  800432:	c3                   	ret    

00800433 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800433:	f3 0f 1e fb          	endbr32 
  800437:	55                   	push   %ebp
  800438:	89 e5                	mov    %esp,%ebp
  80043a:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  80043d:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  800440:	50                   	push   %eax
  800441:	ff 75 08             	pushl  0x8(%ebp)
  800444:	e8 95 ff ff ff       	call   8003de <vcprintf>
	va_end(ap);

	return cnt;
}
  800449:	c9                   	leave  
  80044a:	c3                   	ret    

0080044b <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  80044b:	55                   	push   %ebp
  80044c:	89 e5                	mov    %esp,%ebp
  80044e:	57                   	push   %edi
  80044f:	56                   	push   %esi
  800450:	53                   	push   %ebx
  800451:	83 ec 1c             	sub    $0x1c,%esp
  800454:	89 c7                	mov    %eax,%edi
  800456:	89 d6                	mov    %edx,%esi
  800458:	8b 45 08             	mov    0x8(%ebp),%eax
  80045b:	8b 55 0c             	mov    0xc(%ebp),%edx
  80045e:	89 d1                	mov    %edx,%ecx
  800460:	89 c2                	mov    %eax,%edx
  800462:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800465:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800468:	8b 45 10             	mov    0x10(%ebp),%eax
  80046b:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  80046e:	89 45 e0             	mov    %eax,-0x20(%ebp)
  800471:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  800478:	39 c2                	cmp    %eax,%edx
  80047a:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  80047d:	72 3e                	jb     8004bd <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  80047f:	83 ec 0c             	sub    $0xc,%esp
  800482:	ff 75 18             	pushl  0x18(%ebp)
  800485:	83 eb 01             	sub    $0x1,%ebx
  800488:	53                   	push   %ebx
  800489:	50                   	push   %eax
  80048a:	83 ec 08             	sub    $0x8,%esp
  80048d:	ff 75 e4             	pushl  -0x1c(%ebp)
  800490:	ff 75 e0             	pushl  -0x20(%ebp)
  800493:	ff 75 dc             	pushl  -0x24(%ebp)
  800496:	ff 75 d8             	pushl  -0x28(%ebp)
  800499:	e8 e2 1c 00 00       	call   802180 <__udivdi3>
  80049e:	83 c4 18             	add    $0x18,%esp
  8004a1:	52                   	push   %edx
  8004a2:	50                   	push   %eax
  8004a3:	89 f2                	mov    %esi,%edx
  8004a5:	89 f8                	mov    %edi,%eax
  8004a7:	e8 9f ff ff ff       	call   80044b <printnum>
  8004ac:	83 c4 20             	add    $0x20,%esp
  8004af:	eb 13                	jmp    8004c4 <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  8004b1:	83 ec 08             	sub    $0x8,%esp
  8004b4:	56                   	push   %esi
  8004b5:	ff 75 18             	pushl  0x18(%ebp)
  8004b8:	ff d7                	call   *%edi
  8004ba:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  8004bd:	83 eb 01             	sub    $0x1,%ebx
  8004c0:	85 db                	test   %ebx,%ebx
  8004c2:	7f ed                	jg     8004b1 <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  8004c4:	83 ec 08             	sub    $0x8,%esp
  8004c7:	56                   	push   %esi
  8004c8:	83 ec 04             	sub    $0x4,%esp
  8004cb:	ff 75 e4             	pushl  -0x1c(%ebp)
  8004ce:	ff 75 e0             	pushl  -0x20(%ebp)
  8004d1:	ff 75 dc             	pushl  -0x24(%ebp)
  8004d4:	ff 75 d8             	pushl  -0x28(%ebp)
  8004d7:	e8 b4 1d 00 00       	call   802290 <__umoddi3>
  8004dc:	83 c4 14             	add    $0x14,%esp
  8004df:	0f be 80 9b 24 80 00 	movsbl 0x80249b(%eax),%eax
  8004e6:	50                   	push   %eax
  8004e7:	ff d7                	call   *%edi
}
  8004e9:	83 c4 10             	add    $0x10,%esp
  8004ec:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8004ef:	5b                   	pop    %ebx
  8004f0:	5e                   	pop    %esi
  8004f1:	5f                   	pop    %edi
  8004f2:	5d                   	pop    %ebp
  8004f3:	c3                   	ret    

008004f4 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  8004f4:	f3 0f 1e fb          	endbr32 
  8004f8:	55                   	push   %ebp
  8004f9:	89 e5                	mov    %esp,%ebp
  8004fb:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  8004fe:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800502:	8b 10                	mov    (%eax),%edx
  800504:	3b 50 04             	cmp    0x4(%eax),%edx
  800507:	73 0a                	jae    800513 <sprintputch+0x1f>
		*b->buf++ = ch;
  800509:	8d 4a 01             	lea    0x1(%edx),%ecx
  80050c:	89 08                	mov    %ecx,(%eax)
  80050e:	8b 45 08             	mov    0x8(%ebp),%eax
  800511:	88 02                	mov    %al,(%edx)
}
  800513:	5d                   	pop    %ebp
  800514:	c3                   	ret    

00800515 <printfmt>:
{
  800515:	f3 0f 1e fb          	endbr32 
  800519:	55                   	push   %ebp
  80051a:	89 e5                	mov    %esp,%ebp
  80051c:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  80051f:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  800522:	50                   	push   %eax
  800523:	ff 75 10             	pushl  0x10(%ebp)
  800526:	ff 75 0c             	pushl  0xc(%ebp)
  800529:	ff 75 08             	pushl  0x8(%ebp)
  80052c:	e8 05 00 00 00       	call   800536 <vprintfmt>
}
  800531:	83 c4 10             	add    $0x10,%esp
  800534:	c9                   	leave  
  800535:	c3                   	ret    

00800536 <vprintfmt>:
{
  800536:	f3 0f 1e fb          	endbr32 
  80053a:	55                   	push   %ebp
  80053b:	89 e5                	mov    %esp,%ebp
  80053d:	57                   	push   %edi
  80053e:	56                   	push   %esi
  80053f:	53                   	push   %ebx
  800540:	83 ec 3c             	sub    $0x3c,%esp
  800543:	8b 75 08             	mov    0x8(%ebp),%esi
  800546:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  800549:	8b 7d 10             	mov    0x10(%ebp),%edi
  80054c:	e9 5d 03 00 00       	jmp    8008ae <vprintfmt+0x378>
		padc = ' ';
  800551:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  800555:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  80055c:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  800563:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  80056a:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80056f:	8d 47 01             	lea    0x1(%edi),%eax
  800572:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  800575:	0f b6 17             	movzbl (%edi),%edx
  800578:	8d 42 dd             	lea    -0x23(%edx),%eax
  80057b:	3c 55                	cmp    $0x55,%al
  80057d:	0f 87 ae 03 00 00    	ja     800931 <vprintfmt+0x3fb>
  800583:	0f b6 c0             	movzbl %al,%eax
  800586:	3e ff 24 85 e0 25 80 	notrack jmp *0x8025e0(,%eax,4)
  80058d:	00 
  80058e:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  800591:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  800595:	eb d8                	jmp    80056f <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800597:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  80059a:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  80059e:	eb cf                	jmp    80056f <vprintfmt+0x39>
  8005a0:	0f b6 d2             	movzbl %dl,%edx
  8005a3:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  8005a6:	b8 00 00 00 00       	mov    $0x0,%eax
  8005ab:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  8005ae:	8d 04 80             	lea    (%eax,%eax,4),%eax
  8005b1:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  8005b5:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  8005b8:	8d 4a d0             	lea    -0x30(%edx),%ecx
  8005bb:	83 f9 09             	cmp    $0x9,%ecx
  8005be:	77 55                	ja     800615 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  8005c0:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  8005c3:	eb e9                	jmp    8005ae <vprintfmt+0x78>
			precision = va_arg(ap, int);
  8005c5:	8b 45 14             	mov    0x14(%ebp),%eax
  8005c8:	8b 00                	mov    (%eax),%eax
  8005ca:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8005cd:	8b 45 14             	mov    0x14(%ebp),%eax
  8005d0:	8d 40 04             	lea    0x4(%eax),%eax
  8005d3:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8005d6:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  8005d9:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8005dd:	79 90                	jns    80056f <vprintfmt+0x39>
				width = precision, precision = -1;
  8005df:	8b 45 d8             	mov    -0x28(%ebp),%eax
  8005e2:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8005e5:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  8005ec:	eb 81                	jmp    80056f <vprintfmt+0x39>
  8005ee:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  8005f1:	85 c0                	test   %eax,%eax
  8005f3:	ba 00 00 00 00       	mov    $0x0,%edx
  8005f8:	0f 49 d0             	cmovns %eax,%edx
  8005fb:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8005fe:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800601:	e9 69 ff ff ff       	jmp    80056f <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800606:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800609:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  800610:	e9 5a ff ff ff       	jmp    80056f <vprintfmt+0x39>
  800615:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800618:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80061b:	eb bc                	jmp    8005d9 <vprintfmt+0xa3>
			lflag++;
  80061d:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  800620:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800623:	e9 47 ff ff ff       	jmp    80056f <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  800628:	8b 45 14             	mov    0x14(%ebp),%eax
  80062b:	8d 78 04             	lea    0x4(%eax),%edi
  80062e:	83 ec 08             	sub    $0x8,%esp
  800631:	53                   	push   %ebx
  800632:	ff 30                	pushl  (%eax)
  800634:	ff d6                	call   *%esi
			break;
  800636:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  800639:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  80063c:	e9 6a 02 00 00       	jmp    8008ab <vprintfmt+0x375>
			err = va_arg(ap, int);
  800641:	8b 45 14             	mov    0x14(%ebp),%eax
  800644:	8d 78 04             	lea    0x4(%eax),%edi
  800647:	8b 00                	mov    (%eax),%eax
  800649:	99                   	cltd   
  80064a:	31 d0                	xor    %edx,%eax
  80064c:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  80064e:	83 f8 0f             	cmp    $0xf,%eax
  800651:	7f 23                	jg     800676 <vprintfmt+0x140>
  800653:	8b 14 85 40 27 80 00 	mov    0x802740(,%eax,4),%edx
  80065a:	85 d2                	test   %edx,%edx
  80065c:	74 18                	je     800676 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  80065e:	52                   	push   %edx
  80065f:	68 71 28 80 00       	push   $0x802871
  800664:	53                   	push   %ebx
  800665:	56                   	push   %esi
  800666:	e8 aa fe ff ff       	call   800515 <printfmt>
  80066b:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  80066e:	89 7d 14             	mov    %edi,0x14(%ebp)
  800671:	e9 35 02 00 00       	jmp    8008ab <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  800676:	50                   	push   %eax
  800677:	68 b3 24 80 00       	push   $0x8024b3
  80067c:	53                   	push   %ebx
  80067d:	56                   	push   %esi
  80067e:	e8 92 fe ff ff       	call   800515 <printfmt>
  800683:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  800686:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  800689:	e9 1d 02 00 00       	jmp    8008ab <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  80068e:	8b 45 14             	mov    0x14(%ebp),%eax
  800691:	83 c0 04             	add    $0x4,%eax
  800694:	89 45 c8             	mov    %eax,-0x38(%ebp)
  800697:	8b 45 14             	mov    0x14(%ebp),%eax
  80069a:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  80069c:	85 d2                	test   %edx,%edx
  80069e:	b8 ac 24 80 00       	mov    $0x8024ac,%eax
  8006a3:	0f 45 c2             	cmovne %edx,%eax
  8006a6:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  8006a9:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8006ad:	7e 06                	jle    8006b5 <vprintfmt+0x17f>
  8006af:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  8006b3:	75 0d                	jne    8006c2 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  8006b5:	8b 45 cc             	mov    -0x34(%ebp),%eax
  8006b8:	89 c7                	mov    %eax,%edi
  8006ba:	03 45 d4             	add    -0x2c(%ebp),%eax
  8006bd:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8006c0:	eb 55                	jmp    800717 <vprintfmt+0x1e1>
  8006c2:	83 ec 08             	sub    $0x8,%esp
  8006c5:	ff 75 d8             	pushl  -0x28(%ebp)
  8006c8:	ff 75 cc             	pushl  -0x34(%ebp)
  8006cb:	e8 15 03 00 00       	call   8009e5 <strnlen>
  8006d0:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  8006d3:	29 c2                	sub    %eax,%edx
  8006d5:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  8006d8:	83 c4 10             	add    $0x10,%esp
  8006db:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  8006dd:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  8006e1:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  8006e4:	85 ff                	test   %edi,%edi
  8006e6:	7e 11                	jle    8006f9 <vprintfmt+0x1c3>
					putch(padc, putdat);
  8006e8:	83 ec 08             	sub    $0x8,%esp
  8006eb:	53                   	push   %ebx
  8006ec:	ff 75 d4             	pushl  -0x2c(%ebp)
  8006ef:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  8006f1:	83 ef 01             	sub    $0x1,%edi
  8006f4:	83 c4 10             	add    $0x10,%esp
  8006f7:	eb eb                	jmp    8006e4 <vprintfmt+0x1ae>
  8006f9:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  8006fc:	85 d2                	test   %edx,%edx
  8006fe:	b8 00 00 00 00       	mov    $0x0,%eax
  800703:	0f 49 c2             	cmovns %edx,%eax
  800706:	29 c2                	sub    %eax,%edx
  800708:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  80070b:	eb a8                	jmp    8006b5 <vprintfmt+0x17f>
					putch(ch, putdat);
  80070d:	83 ec 08             	sub    $0x8,%esp
  800710:	53                   	push   %ebx
  800711:	52                   	push   %edx
  800712:	ff d6                	call   *%esi
  800714:	83 c4 10             	add    $0x10,%esp
  800717:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  80071a:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  80071c:	83 c7 01             	add    $0x1,%edi
  80071f:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800723:	0f be d0             	movsbl %al,%edx
  800726:	85 d2                	test   %edx,%edx
  800728:	74 4b                	je     800775 <vprintfmt+0x23f>
  80072a:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  80072e:	78 06                	js     800736 <vprintfmt+0x200>
  800730:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  800734:	78 1e                	js     800754 <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  800736:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  80073a:	74 d1                	je     80070d <vprintfmt+0x1d7>
  80073c:	0f be c0             	movsbl %al,%eax
  80073f:	83 e8 20             	sub    $0x20,%eax
  800742:	83 f8 5e             	cmp    $0x5e,%eax
  800745:	76 c6                	jbe    80070d <vprintfmt+0x1d7>
					putch('?', putdat);
  800747:	83 ec 08             	sub    $0x8,%esp
  80074a:	53                   	push   %ebx
  80074b:	6a 3f                	push   $0x3f
  80074d:	ff d6                	call   *%esi
  80074f:	83 c4 10             	add    $0x10,%esp
  800752:	eb c3                	jmp    800717 <vprintfmt+0x1e1>
  800754:	89 cf                	mov    %ecx,%edi
  800756:	eb 0e                	jmp    800766 <vprintfmt+0x230>
				putch(' ', putdat);
  800758:	83 ec 08             	sub    $0x8,%esp
  80075b:	53                   	push   %ebx
  80075c:	6a 20                	push   $0x20
  80075e:	ff d6                	call   *%esi
			for (; width > 0; width--)
  800760:	83 ef 01             	sub    $0x1,%edi
  800763:	83 c4 10             	add    $0x10,%esp
  800766:	85 ff                	test   %edi,%edi
  800768:	7f ee                	jg     800758 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  80076a:	8b 45 c8             	mov    -0x38(%ebp),%eax
  80076d:	89 45 14             	mov    %eax,0x14(%ebp)
  800770:	e9 36 01 00 00       	jmp    8008ab <vprintfmt+0x375>
  800775:	89 cf                	mov    %ecx,%edi
  800777:	eb ed                	jmp    800766 <vprintfmt+0x230>
	if (lflag >= 2)
  800779:	83 f9 01             	cmp    $0x1,%ecx
  80077c:	7f 1f                	jg     80079d <vprintfmt+0x267>
	else if (lflag)
  80077e:	85 c9                	test   %ecx,%ecx
  800780:	74 67                	je     8007e9 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  800782:	8b 45 14             	mov    0x14(%ebp),%eax
  800785:	8b 00                	mov    (%eax),%eax
  800787:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80078a:	89 c1                	mov    %eax,%ecx
  80078c:	c1 f9 1f             	sar    $0x1f,%ecx
  80078f:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800792:	8b 45 14             	mov    0x14(%ebp),%eax
  800795:	8d 40 04             	lea    0x4(%eax),%eax
  800798:	89 45 14             	mov    %eax,0x14(%ebp)
  80079b:	eb 17                	jmp    8007b4 <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  80079d:	8b 45 14             	mov    0x14(%ebp),%eax
  8007a0:	8b 50 04             	mov    0x4(%eax),%edx
  8007a3:	8b 00                	mov    (%eax),%eax
  8007a5:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8007a8:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8007ab:	8b 45 14             	mov    0x14(%ebp),%eax
  8007ae:	8d 40 08             	lea    0x8(%eax),%eax
  8007b1:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  8007b4:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8007b7:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  8007ba:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  8007bf:	85 c9                	test   %ecx,%ecx
  8007c1:	0f 89 ca 00 00 00    	jns    800891 <vprintfmt+0x35b>
				putch('-', putdat);
  8007c7:	83 ec 08             	sub    $0x8,%esp
  8007ca:	53                   	push   %ebx
  8007cb:	6a 2d                	push   $0x2d
  8007cd:	ff d6                	call   *%esi
				num = -(long long) num;
  8007cf:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8007d2:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  8007d5:	f7 da                	neg    %edx
  8007d7:	83 d1 00             	adc    $0x0,%ecx
  8007da:	f7 d9                	neg    %ecx
  8007dc:	83 c4 10             	add    $0x10,%esp
			base = 10;
  8007df:	b8 0a 00 00 00       	mov    $0xa,%eax
  8007e4:	e9 a8 00 00 00       	jmp    800891 <vprintfmt+0x35b>
		return va_arg(*ap, int);
  8007e9:	8b 45 14             	mov    0x14(%ebp),%eax
  8007ec:	8b 00                	mov    (%eax),%eax
  8007ee:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8007f1:	99                   	cltd   
  8007f2:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8007f5:	8b 45 14             	mov    0x14(%ebp),%eax
  8007f8:	8d 40 04             	lea    0x4(%eax),%eax
  8007fb:	89 45 14             	mov    %eax,0x14(%ebp)
  8007fe:	eb b4                	jmp    8007b4 <vprintfmt+0x27e>
	if (lflag >= 2)
  800800:	83 f9 01             	cmp    $0x1,%ecx
  800803:	7f 1b                	jg     800820 <vprintfmt+0x2ea>
	else if (lflag)
  800805:	85 c9                	test   %ecx,%ecx
  800807:	74 2c                	je     800835 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800809:	8b 45 14             	mov    0x14(%ebp),%eax
  80080c:	8b 10                	mov    (%eax),%edx
  80080e:	b9 00 00 00 00       	mov    $0x0,%ecx
  800813:	8d 40 04             	lea    0x4(%eax),%eax
  800816:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800819:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  80081e:	eb 71                	jmp    800891 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800820:	8b 45 14             	mov    0x14(%ebp),%eax
  800823:	8b 10                	mov    (%eax),%edx
  800825:	8b 48 04             	mov    0x4(%eax),%ecx
  800828:	8d 40 08             	lea    0x8(%eax),%eax
  80082b:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80082e:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  800833:	eb 5c                	jmp    800891 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800835:	8b 45 14             	mov    0x14(%ebp),%eax
  800838:	8b 10                	mov    (%eax),%edx
  80083a:	b9 00 00 00 00       	mov    $0x0,%ecx
  80083f:	8d 40 04             	lea    0x4(%eax),%eax
  800842:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800845:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  80084a:	eb 45                	jmp    800891 <vprintfmt+0x35b>
			putch('X', putdat);
  80084c:	83 ec 08             	sub    $0x8,%esp
  80084f:	53                   	push   %ebx
  800850:	6a 58                	push   $0x58
  800852:	ff d6                	call   *%esi
			putch('X', putdat);
  800854:	83 c4 08             	add    $0x8,%esp
  800857:	53                   	push   %ebx
  800858:	6a 58                	push   $0x58
  80085a:	ff d6                	call   *%esi
			putch('X', putdat);
  80085c:	83 c4 08             	add    $0x8,%esp
  80085f:	53                   	push   %ebx
  800860:	6a 58                	push   $0x58
  800862:	ff d6                	call   *%esi
			break;
  800864:	83 c4 10             	add    $0x10,%esp
  800867:	eb 42                	jmp    8008ab <vprintfmt+0x375>
			putch('0', putdat);
  800869:	83 ec 08             	sub    $0x8,%esp
  80086c:	53                   	push   %ebx
  80086d:	6a 30                	push   $0x30
  80086f:	ff d6                	call   *%esi
			putch('x', putdat);
  800871:	83 c4 08             	add    $0x8,%esp
  800874:	53                   	push   %ebx
  800875:	6a 78                	push   $0x78
  800877:	ff d6                	call   *%esi
			num = (unsigned long long)
  800879:	8b 45 14             	mov    0x14(%ebp),%eax
  80087c:	8b 10                	mov    (%eax),%edx
  80087e:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  800883:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  800886:	8d 40 04             	lea    0x4(%eax),%eax
  800889:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80088c:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  800891:	83 ec 0c             	sub    $0xc,%esp
  800894:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  800898:	57                   	push   %edi
  800899:	ff 75 d4             	pushl  -0x2c(%ebp)
  80089c:	50                   	push   %eax
  80089d:	51                   	push   %ecx
  80089e:	52                   	push   %edx
  80089f:	89 da                	mov    %ebx,%edx
  8008a1:	89 f0                	mov    %esi,%eax
  8008a3:	e8 a3 fb ff ff       	call   80044b <printnum>
			break;
  8008a8:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  8008ab:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  8008ae:	83 c7 01             	add    $0x1,%edi
  8008b1:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  8008b5:	83 f8 25             	cmp    $0x25,%eax
  8008b8:	0f 84 93 fc ff ff    	je     800551 <vprintfmt+0x1b>
			if (ch == '\0')
  8008be:	85 c0                	test   %eax,%eax
  8008c0:	0f 84 8b 00 00 00    	je     800951 <vprintfmt+0x41b>
			putch(ch, putdat);
  8008c6:	83 ec 08             	sub    $0x8,%esp
  8008c9:	53                   	push   %ebx
  8008ca:	50                   	push   %eax
  8008cb:	ff d6                	call   *%esi
  8008cd:	83 c4 10             	add    $0x10,%esp
  8008d0:	eb dc                	jmp    8008ae <vprintfmt+0x378>
	if (lflag >= 2)
  8008d2:	83 f9 01             	cmp    $0x1,%ecx
  8008d5:	7f 1b                	jg     8008f2 <vprintfmt+0x3bc>
	else if (lflag)
  8008d7:	85 c9                	test   %ecx,%ecx
  8008d9:	74 2c                	je     800907 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  8008db:	8b 45 14             	mov    0x14(%ebp),%eax
  8008de:	8b 10                	mov    (%eax),%edx
  8008e0:	b9 00 00 00 00       	mov    $0x0,%ecx
  8008e5:	8d 40 04             	lea    0x4(%eax),%eax
  8008e8:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8008eb:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  8008f0:	eb 9f                	jmp    800891 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  8008f2:	8b 45 14             	mov    0x14(%ebp),%eax
  8008f5:	8b 10                	mov    (%eax),%edx
  8008f7:	8b 48 04             	mov    0x4(%eax),%ecx
  8008fa:	8d 40 08             	lea    0x8(%eax),%eax
  8008fd:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800900:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  800905:	eb 8a                	jmp    800891 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800907:	8b 45 14             	mov    0x14(%ebp),%eax
  80090a:	8b 10                	mov    (%eax),%edx
  80090c:	b9 00 00 00 00       	mov    $0x0,%ecx
  800911:	8d 40 04             	lea    0x4(%eax),%eax
  800914:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800917:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  80091c:	e9 70 ff ff ff       	jmp    800891 <vprintfmt+0x35b>
			putch(ch, putdat);
  800921:	83 ec 08             	sub    $0x8,%esp
  800924:	53                   	push   %ebx
  800925:	6a 25                	push   $0x25
  800927:	ff d6                	call   *%esi
			break;
  800929:	83 c4 10             	add    $0x10,%esp
  80092c:	e9 7a ff ff ff       	jmp    8008ab <vprintfmt+0x375>
			putch('%', putdat);
  800931:	83 ec 08             	sub    $0x8,%esp
  800934:	53                   	push   %ebx
  800935:	6a 25                	push   $0x25
  800937:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800939:	83 c4 10             	add    $0x10,%esp
  80093c:	89 f8                	mov    %edi,%eax
  80093e:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  800942:	74 05                	je     800949 <vprintfmt+0x413>
  800944:	83 e8 01             	sub    $0x1,%eax
  800947:	eb f5                	jmp    80093e <vprintfmt+0x408>
  800949:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80094c:	e9 5a ff ff ff       	jmp    8008ab <vprintfmt+0x375>
}
  800951:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800954:	5b                   	pop    %ebx
  800955:	5e                   	pop    %esi
  800956:	5f                   	pop    %edi
  800957:	5d                   	pop    %ebp
  800958:	c3                   	ret    

00800959 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  800959:	f3 0f 1e fb          	endbr32 
  80095d:	55                   	push   %ebp
  80095e:	89 e5                	mov    %esp,%ebp
  800960:	83 ec 18             	sub    $0x18,%esp
  800963:	8b 45 08             	mov    0x8(%ebp),%eax
  800966:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  800969:	89 45 ec             	mov    %eax,-0x14(%ebp)
  80096c:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  800970:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  800973:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  80097a:	85 c0                	test   %eax,%eax
  80097c:	74 26                	je     8009a4 <vsnprintf+0x4b>
  80097e:	85 d2                	test   %edx,%edx
  800980:	7e 22                	jle    8009a4 <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  800982:	ff 75 14             	pushl  0x14(%ebp)
  800985:	ff 75 10             	pushl  0x10(%ebp)
  800988:	8d 45 ec             	lea    -0x14(%ebp),%eax
  80098b:	50                   	push   %eax
  80098c:	68 f4 04 80 00       	push   $0x8004f4
  800991:	e8 a0 fb ff ff       	call   800536 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  800996:	8b 45 ec             	mov    -0x14(%ebp),%eax
  800999:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  80099c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80099f:	83 c4 10             	add    $0x10,%esp
}
  8009a2:	c9                   	leave  
  8009a3:	c3                   	ret    
		return -E_INVAL;
  8009a4:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8009a9:	eb f7                	jmp    8009a2 <vsnprintf+0x49>

008009ab <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  8009ab:	f3 0f 1e fb          	endbr32 
  8009af:	55                   	push   %ebp
  8009b0:	89 e5                	mov    %esp,%ebp
  8009b2:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  8009b5:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  8009b8:	50                   	push   %eax
  8009b9:	ff 75 10             	pushl  0x10(%ebp)
  8009bc:	ff 75 0c             	pushl  0xc(%ebp)
  8009bf:	ff 75 08             	pushl  0x8(%ebp)
  8009c2:	e8 92 ff ff ff       	call   800959 <vsnprintf>
	va_end(ap);

	return rc;
}
  8009c7:	c9                   	leave  
  8009c8:	c3                   	ret    

008009c9 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  8009c9:	f3 0f 1e fb          	endbr32 
  8009cd:	55                   	push   %ebp
  8009ce:	89 e5                	mov    %esp,%ebp
  8009d0:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  8009d3:	b8 00 00 00 00       	mov    $0x0,%eax
  8009d8:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  8009dc:	74 05                	je     8009e3 <strlen+0x1a>
		n++;
  8009de:	83 c0 01             	add    $0x1,%eax
  8009e1:	eb f5                	jmp    8009d8 <strlen+0xf>
	return n;
}
  8009e3:	5d                   	pop    %ebp
  8009e4:	c3                   	ret    

008009e5 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  8009e5:	f3 0f 1e fb          	endbr32 
  8009e9:	55                   	push   %ebp
  8009ea:	89 e5                	mov    %esp,%ebp
  8009ec:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8009ef:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  8009f2:	b8 00 00 00 00       	mov    $0x0,%eax
  8009f7:	39 d0                	cmp    %edx,%eax
  8009f9:	74 0d                	je     800a08 <strnlen+0x23>
  8009fb:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  8009ff:	74 05                	je     800a06 <strnlen+0x21>
		n++;
  800a01:	83 c0 01             	add    $0x1,%eax
  800a04:	eb f1                	jmp    8009f7 <strnlen+0x12>
  800a06:	89 c2                	mov    %eax,%edx
	return n;
}
  800a08:	89 d0                	mov    %edx,%eax
  800a0a:	5d                   	pop    %ebp
  800a0b:	c3                   	ret    

00800a0c <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  800a0c:	f3 0f 1e fb          	endbr32 
  800a10:	55                   	push   %ebp
  800a11:	89 e5                	mov    %esp,%ebp
  800a13:	53                   	push   %ebx
  800a14:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800a17:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800a1a:	b8 00 00 00 00       	mov    $0x0,%eax
  800a1f:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  800a23:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  800a26:	83 c0 01             	add    $0x1,%eax
  800a29:	84 d2                	test   %dl,%dl
  800a2b:	75 f2                	jne    800a1f <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  800a2d:	89 c8                	mov    %ecx,%eax
  800a2f:	5b                   	pop    %ebx
  800a30:	5d                   	pop    %ebp
  800a31:	c3                   	ret    

00800a32 <strcat>:

char *
strcat(char *dst, const char *src)
{
  800a32:	f3 0f 1e fb          	endbr32 
  800a36:	55                   	push   %ebp
  800a37:	89 e5                	mov    %esp,%ebp
  800a39:	53                   	push   %ebx
  800a3a:	83 ec 10             	sub    $0x10,%esp
  800a3d:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  800a40:	53                   	push   %ebx
  800a41:	e8 83 ff ff ff       	call   8009c9 <strlen>
  800a46:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  800a49:	ff 75 0c             	pushl  0xc(%ebp)
  800a4c:	01 d8                	add    %ebx,%eax
  800a4e:	50                   	push   %eax
  800a4f:	e8 b8 ff ff ff       	call   800a0c <strcpy>
	return dst;
}
  800a54:	89 d8                	mov    %ebx,%eax
  800a56:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800a59:	c9                   	leave  
  800a5a:	c3                   	ret    

00800a5b <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  800a5b:	f3 0f 1e fb          	endbr32 
  800a5f:	55                   	push   %ebp
  800a60:	89 e5                	mov    %esp,%ebp
  800a62:	56                   	push   %esi
  800a63:	53                   	push   %ebx
  800a64:	8b 75 08             	mov    0x8(%ebp),%esi
  800a67:	8b 55 0c             	mov    0xc(%ebp),%edx
  800a6a:	89 f3                	mov    %esi,%ebx
  800a6c:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  800a6f:	89 f0                	mov    %esi,%eax
  800a71:	39 d8                	cmp    %ebx,%eax
  800a73:	74 11                	je     800a86 <strncpy+0x2b>
		*dst++ = *src;
  800a75:	83 c0 01             	add    $0x1,%eax
  800a78:	0f b6 0a             	movzbl (%edx),%ecx
  800a7b:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  800a7e:	80 f9 01             	cmp    $0x1,%cl
  800a81:	83 da ff             	sbb    $0xffffffff,%edx
  800a84:	eb eb                	jmp    800a71 <strncpy+0x16>
	}
	return ret;
}
  800a86:	89 f0                	mov    %esi,%eax
  800a88:	5b                   	pop    %ebx
  800a89:	5e                   	pop    %esi
  800a8a:	5d                   	pop    %ebp
  800a8b:	c3                   	ret    

00800a8c <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  800a8c:	f3 0f 1e fb          	endbr32 
  800a90:	55                   	push   %ebp
  800a91:	89 e5                	mov    %esp,%ebp
  800a93:	56                   	push   %esi
  800a94:	53                   	push   %ebx
  800a95:	8b 75 08             	mov    0x8(%ebp),%esi
  800a98:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800a9b:	8b 55 10             	mov    0x10(%ebp),%edx
  800a9e:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  800aa0:	85 d2                	test   %edx,%edx
  800aa2:	74 21                	je     800ac5 <strlcpy+0x39>
  800aa4:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  800aa8:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  800aaa:	39 c2                	cmp    %eax,%edx
  800aac:	74 14                	je     800ac2 <strlcpy+0x36>
  800aae:	0f b6 19             	movzbl (%ecx),%ebx
  800ab1:	84 db                	test   %bl,%bl
  800ab3:	74 0b                	je     800ac0 <strlcpy+0x34>
			*dst++ = *src++;
  800ab5:	83 c1 01             	add    $0x1,%ecx
  800ab8:	83 c2 01             	add    $0x1,%edx
  800abb:	88 5a ff             	mov    %bl,-0x1(%edx)
  800abe:	eb ea                	jmp    800aaa <strlcpy+0x1e>
  800ac0:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  800ac2:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800ac5:	29 f0                	sub    %esi,%eax
}
  800ac7:	5b                   	pop    %ebx
  800ac8:	5e                   	pop    %esi
  800ac9:	5d                   	pop    %ebp
  800aca:	c3                   	ret    

00800acb <strcmp>:

int
strcmp(const char *p, const char *q)
{
  800acb:	f3 0f 1e fb          	endbr32 
  800acf:	55                   	push   %ebp
  800ad0:	89 e5                	mov    %esp,%ebp
  800ad2:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800ad5:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800ad8:	0f b6 01             	movzbl (%ecx),%eax
  800adb:	84 c0                	test   %al,%al
  800add:	74 0c                	je     800aeb <strcmp+0x20>
  800adf:	3a 02                	cmp    (%edx),%al
  800ae1:	75 08                	jne    800aeb <strcmp+0x20>
		p++, q++;
  800ae3:	83 c1 01             	add    $0x1,%ecx
  800ae6:	83 c2 01             	add    $0x1,%edx
  800ae9:	eb ed                	jmp    800ad8 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  800aeb:	0f b6 c0             	movzbl %al,%eax
  800aee:	0f b6 12             	movzbl (%edx),%edx
  800af1:	29 d0                	sub    %edx,%eax
}
  800af3:	5d                   	pop    %ebp
  800af4:	c3                   	ret    

00800af5 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800af5:	f3 0f 1e fb          	endbr32 
  800af9:	55                   	push   %ebp
  800afa:	89 e5                	mov    %esp,%ebp
  800afc:	53                   	push   %ebx
  800afd:	8b 45 08             	mov    0x8(%ebp),%eax
  800b00:	8b 55 0c             	mov    0xc(%ebp),%edx
  800b03:	89 c3                	mov    %eax,%ebx
  800b05:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800b08:	eb 06                	jmp    800b10 <strncmp+0x1b>
		n--, p++, q++;
  800b0a:	83 c0 01             	add    $0x1,%eax
  800b0d:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  800b10:	39 d8                	cmp    %ebx,%eax
  800b12:	74 16                	je     800b2a <strncmp+0x35>
  800b14:	0f b6 08             	movzbl (%eax),%ecx
  800b17:	84 c9                	test   %cl,%cl
  800b19:	74 04                	je     800b1f <strncmp+0x2a>
  800b1b:	3a 0a                	cmp    (%edx),%cl
  800b1d:	74 eb                	je     800b0a <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  800b1f:	0f b6 00             	movzbl (%eax),%eax
  800b22:	0f b6 12             	movzbl (%edx),%edx
  800b25:	29 d0                	sub    %edx,%eax
}
  800b27:	5b                   	pop    %ebx
  800b28:	5d                   	pop    %ebp
  800b29:	c3                   	ret    
		return 0;
  800b2a:	b8 00 00 00 00       	mov    $0x0,%eax
  800b2f:	eb f6                	jmp    800b27 <strncmp+0x32>

00800b31 <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  800b31:	f3 0f 1e fb          	endbr32 
  800b35:	55                   	push   %ebp
  800b36:	89 e5                	mov    %esp,%ebp
  800b38:	8b 45 08             	mov    0x8(%ebp),%eax
  800b3b:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  800b3f:	0f b6 10             	movzbl (%eax),%edx
  800b42:	84 d2                	test   %dl,%dl
  800b44:	74 09                	je     800b4f <strchr+0x1e>
		if (*s == c)
  800b46:	38 ca                	cmp    %cl,%dl
  800b48:	74 0a                	je     800b54 <strchr+0x23>
	for (; *s; s++)
  800b4a:	83 c0 01             	add    $0x1,%eax
  800b4d:	eb f0                	jmp    800b3f <strchr+0xe>
			return (char *) s;
	return 0;
  800b4f:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800b54:	5d                   	pop    %ebp
  800b55:	c3                   	ret    

00800b56 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  800b56:	f3 0f 1e fb          	endbr32 
  800b5a:	55                   	push   %ebp
  800b5b:	89 e5                	mov    %esp,%ebp
  800b5d:	8b 45 08             	mov    0x8(%ebp),%eax
  800b60:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  800b64:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  800b67:	38 ca                	cmp    %cl,%dl
  800b69:	74 09                	je     800b74 <strfind+0x1e>
  800b6b:	84 d2                	test   %dl,%dl
  800b6d:	74 05                	je     800b74 <strfind+0x1e>
	for (; *s; s++)
  800b6f:	83 c0 01             	add    $0x1,%eax
  800b72:	eb f0                	jmp    800b64 <strfind+0xe>
			break;
	return (char *) s;
}
  800b74:	5d                   	pop    %ebp
  800b75:	c3                   	ret    

00800b76 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  800b76:	f3 0f 1e fb          	endbr32 
  800b7a:	55                   	push   %ebp
  800b7b:	89 e5                	mov    %esp,%ebp
  800b7d:	57                   	push   %edi
  800b7e:	56                   	push   %esi
  800b7f:	53                   	push   %ebx
  800b80:	8b 7d 08             	mov    0x8(%ebp),%edi
  800b83:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  800b86:	85 c9                	test   %ecx,%ecx
  800b88:	74 31                	je     800bbb <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  800b8a:	89 f8                	mov    %edi,%eax
  800b8c:	09 c8                	or     %ecx,%eax
  800b8e:	a8 03                	test   $0x3,%al
  800b90:	75 23                	jne    800bb5 <memset+0x3f>
		c &= 0xFF;
  800b92:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  800b96:	89 d3                	mov    %edx,%ebx
  800b98:	c1 e3 08             	shl    $0x8,%ebx
  800b9b:	89 d0                	mov    %edx,%eax
  800b9d:	c1 e0 18             	shl    $0x18,%eax
  800ba0:	89 d6                	mov    %edx,%esi
  800ba2:	c1 e6 10             	shl    $0x10,%esi
  800ba5:	09 f0                	or     %esi,%eax
  800ba7:	09 c2                	or     %eax,%edx
  800ba9:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  800bab:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  800bae:	89 d0                	mov    %edx,%eax
  800bb0:	fc                   	cld    
  800bb1:	f3 ab                	rep stos %eax,%es:(%edi)
  800bb3:	eb 06                	jmp    800bbb <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  800bb5:	8b 45 0c             	mov    0xc(%ebp),%eax
  800bb8:	fc                   	cld    
  800bb9:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  800bbb:	89 f8                	mov    %edi,%eax
  800bbd:	5b                   	pop    %ebx
  800bbe:	5e                   	pop    %esi
  800bbf:	5f                   	pop    %edi
  800bc0:	5d                   	pop    %ebp
  800bc1:	c3                   	ret    

00800bc2 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800bc2:	f3 0f 1e fb          	endbr32 
  800bc6:	55                   	push   %ebp
  800bc7:	89 e5                	mov    %esp,%ebp
  800bc9:	57                   	push   %edi
  800bca:	56                   	push   %esi
  800bcb:	8b 45 08             	mov    0x8(%ebp),%eax
  800bce:	8b 75 0c             	mov    0xc(%ebp),%esi
  800bd1:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800bd4:	39 c6                	cmp    %eax,%esi
  800bd6:	73 32                	jae    800c0a <memmove+0x48>
  800bd8:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  800bdb:	39 c2                	cmp    %eax,%edx
  800bdd:	76 2b                	jbe    800c0a <memmove+0x48>
		s += n;
		d += n;
  800bdf:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800be2:	89 fe                	mov    %edi,%esi
  800be4:	09 ce                	or     %ecx,%esi
  800be6:	09 d6                	or     %edx,%esi
  800be8:	f7 c6 03 00 00 00    	test   $0x3,%esi
  800bee:	75 0e                	jne    800bfe <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  800bf0:	83 ef 04             	sub    $0x4,%edi
  800bf3:	8d 72 fc             	lea    -0x4(%edx),%esi
  800bf6:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800bf9:	fd                   	std    
  800bfa:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800bfc:	eb 09                	jmp    800c07 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  800bfe:	83 ef 01             	sub    $0x1,%edi
  800c01:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800c04:	fd                   	std    
  800c05:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800c07:	fc                   	cld    
  800c08:	eb 1a                	jmp    800c24 <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800c0a:	89 c2                	mov    %eax,%edx
  800c0c:	09 ca                	or     %ecx,%edx
  800c0e:	09 f2                	or     %esi,%edx
  800c10:	f6 c2 03             	test   $0x3,%dl
  800c13:	75 0a                	jne    800c1f <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800c15:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800c18:	89 c7                	mov    %eax,%edi
  800c1a:	fc                   	cld    
  800c1b:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800c1d:	eb 05                	jmp    800c24 <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  800c1f:	89 c7                	mov    %eax,%edi
  800c21:	fc                   	cld    
  800c22:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800c24:	5e                   	pop    %esi
  800c25:	5f                   	pop    %edi
  800c26:	5d                   	pop    %ebp
  800c27:	c3                   	ret    

00800c28 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800c28:	f3 0f 1e fb          	endbr32 
  800c2c:	55                   	push   %ebp
  800c2d:	89 e5                	mov    %esp,%ebp
  800c2f:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800c32:	ff 75 10             	pushl  0x10(%ebp)
  800c35:	ff 75 0c             	pushl  0xc(%ebp)
  800c38:	ff 75 08             	pushl  0x8(%ebp)
  800c3b:	e8 82 ff ff ff       	call   800bc2 <memmove>
}
  800c40:	c9                   	leave  
  800c41:	c3                   	ret    

00800c42 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800c42:	f3 0f 1e fb          	endbr32 
  800c46:	55                   	push   %ebp
  800c47:	89 e5                	mov    %esp,%ebp
  800c49:	56                   	push   %esi
  800c4a:	53                   	push   %ebx
  800c4b:	8b 45 08             	mov    0x8(%ebp),%eax
  800c4e:	8b 55 0c             	mov    0xc(%ebp),%edx
  800c51:	89 c6                	mov    %eax,%esi
  800c53:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800c56:	39 f0                	cmp    %esi,%eax
  800c58:	74 1c                	je     800c76 <memcmp+0x34>
		if (*s1 != *s2)
  800c5a:	0f b6 08             	movzbl (%eax),%ecx
  800c5d:	0f b6 1a             	movzbl (%edx),%ebx
  800c60:	38 d9                	cmp    %bl,%cl
  800c62:	75 08                	jne    800c6c <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  800c64:	83 c0 01             	add    $0x1,%eax
  800c67:	83 c2 01             	add    $0x1,%edx
  800c6a:	eb ea                	jmp    800c56 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  800c6c:	0f b6 c1             	movzbl %cl,%eax
  800c6f:	0f b6 db             	movzbl %bl,%ebx
  800c72:	29 d8                	sub    %ebx,%eax
  800c74:	eb 05                	jmp    800c7b <memcmp+0x39>
	}

	return 0;
  800c76:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800c7b:	5b                   	pop    %ebx
  800c7c:	5e                   	pop    %esi
  800c7d:	5d                   	pop    %ebp
  800c7e:	c3                   	ret    

00800c7f <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  800c7f:	f3 0f 1e fb          	endbr32 
  800c83:	55                   	push   %ebp
  800c84:	89 e5                	mov    %esp,%ebp
  800c86:	8b 45 08             	mov    0x8(%ebp),%eax
  800c89:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  800c8c:	89 c2                	mov    %eax,%edx
  800c8e:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800c91:	39 d0                	cmp    %edx,%eax
  800c93:	73 09                	jae    800c9e <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800c95:	38 08                	cmp    %cl,(%eax)
  800c97:	74 05                	je     800c9e <memfind+0x1f>
	for (; s < ends; s++)
  800c99:	83 c0 01             	add    $0x1,%eax
  800c9c:	eb f3                	jmp    800c91 <memfind+0x12>
			break;
	return (void *) s;
}
  800c9e:	5d                   	pop    %ebp
  800c9f:	c3                   	ret    

00800ca0 <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800ca0:	f3 0f 1e fb          	endbr32 
  800ca4:	55                   	push   %ebp
  800ca5:	89 e5                	mov    %esp,%ebp
  800ca7:	57                   	push   %edi
  800ca8:	56                   	push   %esi
  800ca9:	53                   	push   %ebx
  800caa:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800cad:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800cb0:	eb 03                	jmp    800cb5 <strtol+0x15>
		s++;
  800cb2:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800cb5:	0f b6 01             	movzbl (%ecx),%eax
  800cb8:	3c 20                	cmp    $0x20,%al
  800cba:	74 f6                	je     800cb2 <strtol+0x12>
  800cbc:	3c 09                	cmp    $0x9,%al
  800cbe:	74 f2                	je     800cb2 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800cc0:	3c 2b                	cmp    $0x2b,%al
  800cc2:	74 2a                	je     800cee <strtol+0x4e>
	int neg = 0;
  800cc4:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800cc9:	3c 2d                	cmp    $0x2d,%al
  800ccb:	74 2b                	je     800cf8 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800ccd:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800cd3:	75 0f                	jne    800ce4 <strtol+0x44>
  800cd5:	80 39 30             	cmpb   $0x30,(%ecx)
  800cd8:	74 28                	je     800d02 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800cda:	85 db                	test   %ebx,%ebx
  800cdc:	b8 0a 00 00 00       	mov    $0xa,%eax
  800ce1:	0f 44 d8             	cmove  %eax,%ebx
  800ce4:	b8 00 00 00 00       	mov    $0x0,%eax
  800ce9:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800cec:	eb 46                	jmp    800d34 <strtol+0x94>
		s++;
  800cee:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800cf1:	bf 00 00 00 00       	mov    $0x0,%edi
  800cf6:	eb d5                	jmp    800ccd <strtol+0x2d>
		s++, neg = 1;
  800cf8:	83 c1 01             	add    $0x1,%ecx
  800cfb:	bf 01 00 00 00       	mov    $0x1,%edi
  800d00:	eb cb                	jmp    800ccd <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800d02:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800d06:	74 0e                	je     800d16 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800d08:	85 db                	test   %ebx,%ebx
  800d0a:	75 d8                	jne    800ce4 <strtol+0x44>
		s++, base = 8;
  800d0c:	83 c1 01             	add    $0x1,%ecx
  800d0f:	bb 08 00 00 00       	mov    $0x8,%ebx
  800d14:	eb ce                	jmp    800ce4 <strtol+0x44>
		s += 2, base = 16;
  800d16:	83 c1 02             	add    $0x2,%ecx
  800d19:	bb 10 00 00 00       	mov    $0x10,%ebx
  800d1e:	eb c4                	jmp    800ce4 <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800d20:	0f be d2             	movsbl %dl,%edx
  800d23:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800d26:	3b 55 10             	cmp    0x10(%ebp),%edx
  800d29:	7d 3a                	jge    800d65 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800d2b:	83 c1 01             	add    $0x1,%ecx
  800d2e:	0f af 45 10          	imul   0x10(%ebp),%eax
  800d32:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800d34:	0f b6 11             	movzbl (%ecx),%edx
  800d37:	8d 72 d0             	lea    -0x30(%edx),%esi
  800d3a:	89 f3                	mov    %esi,%ebx
  800d3c:	80 fb 09             	cmp    $0x9,%bl
  800d3f:	76 df                	jbe    800d20 <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800d41:	8d 72 9f             	lea    -0x61(%edx),%esi
  800d44:	89 f3                	mov    %esi,%ebx
  800d46:	80 fb 19             	cmp    $0x19,%bl
  800d49:	77 08                	ja     800d53 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800d4b:	0f be d2             	movsbl %dl,%edx
  800d4e:	83 ea 57             	sub    $0x57,%edx
  800d51:	eb d3                	jmp    800d26 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800d53:	8d 72 bf             	lea    -0x41(%edx),%esi
  800d56:	89 f3                	mov    %esi,%ebx
  800d58:	80 fb 19             	cmp    $0x19,%bl
  800d5b:	77 08                	ja     800d65 <strtol+0xc5>
			dig = *s - 'A' + 10;
  800d5d:	0f be d2             	movsbl %dl,%edx
  800d60:	83 ea 37             	sub    $0x37,%edx
  800d63:	eb c1                	jmp    800d26 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800d65:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800d69:	74 05                	je     800d70 <strtol+0xd0>
		*endptr = (char *) s;
  800d6b:	8b 75 0c             	mov    0xc(%ebp),%esi
  800d6e:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800d70:	89 c2                	mov    %eax,%edx
  800d72:	f7 da                	neg    %edx
  800d74:	85 ff                	test   %edi,%edi
  800d76:	0f 45 c2             	cmovne %edx,%eax
}
  800d79:	5b                   	pop    %ebx
  800d7a:	5e                   	pop    %esi
  800d7b:	5f                   	pop    %edi
  800d7c:	5d                   	pop    %ebp
  800d7d:	c3                   	ret    

00800d7e <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800d7e:	f3 0f 1e fb          	endbr32 
  800d82:	55                   	push   %ebp
  800d83:	89 e5                	mov    %esp,%ebp
  800d85:	57                   	push   %edi
  800d86:	56                   	push   %esi
  800d87:	53                   	push   %ebx
	asm volatile("int %1\n"
  800d88:	b8 00 00 00 00       	mov    $0x0,%eax
  800d8d:	8b 55 08             	mov    0x8(%ebp),%edx
  800d90:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d93:	89 c3                	mov    %eax,%ebx
  800d95:	89 c7                	mov    %eax,%edi
  800d97:	89 c6                	mov    %eax,%esi
  800d99:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800d9b:	5b                   	pop    %ebx
  800d9c:	5e                   	pop    %esi
  800d9d:	5f                   	pop    %edi
  800d9e:	5d                   	pop    %ebp
  800d9f:	c3                   	ret    

00800da0 <sys_cgetc>:

int
sys_cgetc(void)
{
  800da0:	f3 0f 1e fb          	endbr32 
  800da4:	55                   	push   %ebp
  800da5:	89 e5                	mov    %esp,%ebp
  800da7:	57                   	push   %edi
  800da8:	56                   	push   %esi
  800da9:	53                   	push   %ebx
	asm volatile("int %1\n"
  800daa:	ba 00 00 00 00       	mov    $0x0,%edx
  800daf:	b8 01 00 00 00       	mov    $0x1,%eax
  800db4:	89 d1                	mov    %edx,%ecx
  800db6:	89 d3                	mov    %edx,%ebx
  800db8:	89 d7                	mov    %edx,%edi
  800dba:	89 d6                	mov    %edx,%esi
  800dbc:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800dbe:	5b                   	pop    %ebx
  800dbf:	5e                   	pop    %esi
  800dc0:	5f                   	pop    %edi
  800dc1:	5d                   	pop    %ebp
  800dc2:	c3                   	ret    

00800dc3 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800dc3:	f3 0f 1e fb          	endbr32 
  800dc7:	55                   	push   %ebp
  800dc8:	89 e5                	mov    %esp,%ebp
  800dca:	57                   	push   %edi
  800dcb:	56                   	push   %esi
  800dcc:	53                   	push   %ebx
  800dcd:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800dd0:	b9 00 00 00 00       	mov    $0x0,%ecx
  800dd5:	8b 55 08             	mov    0x8(%ebp),%edx
  800dd8:	b8 03 00 00 00       	mov    $0x3,%eax
  800ddd:	89 cb                	mov    %ecx,%ebx
  800ddf:	89 cf                	mov    %ecx,%edi
  800de1:	89 ce                	mov    %ecx,%esi
  800de3:	cd 30                	int    $0x30
	if(check && ret > 0)
  800de5:	85 c0                	test   %eax,%eax
  800de7:	7f 08                	jg     800df1 <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800de9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800dec:	5b                   	pop    %ebx
  800ded:	5e                   	pop    %esi
  800dee:	5f                   	pop    %edi
  800def:	5d                   	pop    %ebp
  800df0:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800df1:	83 ec 0c             	sub    $0xc,%esp
  800df4:	50                   	push   %eax
  800df5:	6a 03                	push   $0x3
  800df7:	68 9f 27 80 00       	push   $0x80279f
  800dfc:	6a 23                	push   $0x23
  800dfe:	68 bc 27 80 00       	push   $0x8027bc
  800e03:	e8 44 f5 ff ff       	call   80034c <_panic>

00800e08 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800e08:	f3 0f 1e fb          	endbr32 
  800e0c:	55                   	push   %ebp
  800e0d:	89 e5                	mov    %esp,%ebp
  800e0f:	57                   	push   %edi
  800e10:	56                   	push   %esi
  800e11:	53                   	push   %ebx
	asm volatile("int %1\n"
  800e12:	ba 00 00 00 00       	mov    $0x0,%edx
  800e17:	b8 02 00 00 00       	mov    $0x2,%eax
  800e1c:	89 d1                	mov    %edx,%ecx
  800e1e:	89 d3                	mov    %edx,%ebx
  800e20:	89 d7                	mov    %edx,%edi
  800e22:	89 d6                	mov    %edx,%esi
  800e24:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800e26:	5b                   	pop    %ebx
  800e27:	5e                   	pop    %esi
  800e28:	5f                   	pop    %edi
  800e29:	5d                   	pop    %ebp
  800e2a:	c3                   	ret    

00800e2b <sys_yield>:

void
sys_yield(void)
{
  800e2b:	f3 0f 1e fb          	endbr32 
  800e2f:	55                   	push   %ebp
  800e30:	89 e5                	mov    %esp,%ebp
  800e32:	57                   	push   %edi
  800e33:	56                   	push   %esi
  800e34:	53                   	push   %ebx
	asm volatile("int %1\n"
  800e35:	ba 00 00 00 00       	mov    $0x0,%edx
  800e3a:	b8 0b 00 00 00       	mov    $0xb,%eax
  800e3f:	89 d1                	mov    %edx,%ecx
  800e41:	89 d3                	mov    %edx,%ebx
  800e43:	89 d7                	mov    %edx,%edi
  800e45:	89 d6                	mov    %edx,%esi
  800e47:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800e49:	5b                   	pop    %ebx
  800e4a:	5e                   	pop    %esi
  800e4b:	5f                   	pop    %edi
  800e4c:	5d                   	pop    %ebp
  800e4d:	c3                   	ret    

00800e4e <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800e4e:	f3 0f 1e fb          	endbr32 
  800e52:	55                   	push   %ebp
  800e53:	89 e5                	mov    %esp,%ebp
  800e55:	57                   	push   %edi
  800e56:	56                   	push   %esi
  800e57:	53                   	push   %ebx
  800e58:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800e5b:	be 00 00 00 00       	mov    $0x0,%esi
  800e60:	8b 55 08             	mov    0x8(%ebp),%edx
  800e63:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800e66:	b8 04 00 00 00       	mov    $0x4,%eax
  800e6b:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800e6e:	89 f7                	mov    %esi,%edi
  800e70:	cd 30                	int    $0x30
	if(check && ret > 0)
  800e72:	85 c0                	test   %eax,%eax
  800e74:	7f 08                	jg     800e7e <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800e76:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800e79:	5b                   	pop    %ebx
  800e7a:	5e                   	pop    %esi
  800e7b:	5f                   	pop    %edi
  800e7c:	5d                   	pop    %ebp
  800e7d:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800e7e:	83 ec 0c             	sub    $0xc,%esp
  800e81:	50                   	push   %eax
  800e82:	6a 04                	push   $0x4
  800e84:	68 9f 27 80 00       	push   $0x80279f
  800e89:	6a 23                	push   $0x23
  800e8b:	68 bc 27 80 00       	push   $0x8027bc
  800e90:	e8 b7 f4 ff ff       	call   80034c <_panic>

00800e95 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800e95:	f3 0f 1e fb          	endbr32 
  800e99:	55                   	push   %ebp
  800e9a:	89 e5                	mov    %esp,%ebp
  800e9c:	57                   	push   %edi
  800e9d:	56                   	push   %esi
  800e9e:	53                   	push   %ebx
  800e9f:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800ea2:	8b 55 08             	mov    0x8(%ebp),%edx
  800ea5:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ea8:	b8 05 00 00 00       	mov    $0x5,%eax
  800ead:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800eb0:	8b 7d 14             	mov    0x14(%ebp),%edi
  800eb3:	8b 75 18             	mov    0x18(%ebp),%esi
  800eb6:	cd 30                	int    $0x30
	if(check && ret > 0)
  800eb8:	85 c0                	test   %eax,%eax
  800eba:	7f 08                	jg     800ec4 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800ebc:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ebf:	5b                   	pop    %ebx
  800ec0:	5e                   	pop    %esi
  800ec1:	5f                   	pop    %edi
  800ec2:	5d                   	pop    %ebp
  800ec3:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800ec4:	83 ec 0c             	sub    $0xc,%esp
  800ec7:	50                   	push   %eax
  800ec8:	6a 05                	push   $0x5
  800eca:	68 9f 27 80 00       	push   $0x80279f
  800ecf:	6a 23                	push   $0x23
  800ed1:	68 bc 27 80 00       	push   $0x8027bc
  800ed6:	e8 71 f4 ff ff       	call   80034c <_panic>

00800edb <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800edb:	f3 0f 1e fb          	endbr32 
  800edf:	55                   	push   %ebp
  800ee0:	89 e5                	mov    %esp,%ebp
  800ee2:	57                   	push   %edi
  800ee3:	56                   	push   %esi
  800ee4:	53                   	push   %ebx
  800ee5:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800ee8:	bb 00 00 00 00       	mov    $0x0,%ebx
  800eed:	8b 55 08             	mov    0x8(%ebp),%edx
  800ef0:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ef3:	b8 06 00 00 00       	mov    $0x6,%eax
  800ef8:	89 df                	mov    %ebx,%edi
  800efa:	89 de                	mov    %ebx,%esi
  800efc:	cd 30                	int    $0x30
	if(check && ret > 0)
  800efe:	85 c0                	test   %eax,%eax
  800f00:	7f 08                	jg     800f0a <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800f02:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f05:	5b                   	pop    %ebx
  800f06:	5e                   	pop    %esi
  800f07:	5f                   	pop    %edi
  800f08:	5d                   	pop    %ebp
  800f09:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800f0a:	83 ec 0c             	sub    $0xc,%esp
  800f0d:	50                   	push   %eax
  800f0e:	6a 06                	push   $0x6
  800f10:	68 9f 27 80 00       	push   $0x80279f
  800f15:	6a 23                	push   $0x23
  800f17:	68 bc 27 80 00       	push   $0x8027bc
  800f1c:	e8 2b f4 ff ff       	call   80034c <_panic>

00800f21 <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800f21:	f3 0f 1e fb          	endbr32 
  800f25:	55                   	push   %ebp
  800f26:	89 e5                	mov    %esp,%ebp
  800f28:	57                   	push   %edi
  800f29:	56                   	push   %esi
  800f2a:	53                   	push   %ebx
  800f2b:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800f2e:	bb 00 00 00 00       	mov    $0x0,%ebx
  800f33:	8b 55 08             	mov    0x8(%ebp),%edx
  800f36:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800f39:	b8 08 00 00 00       	mov    $0x8,%eax
  800f3e:	89 df                	mov    %ebx,%edi
  800f40:	89 de                	mov    %ebx,%esi
  800f42:	cd 30                	int    $0x30
	if(check && ret > 0)
  800f44:	85 c0                	test   %eax,%eax
  800f46:	7f 08                	jg     800f50 <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800f48:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f4b:	5b                   	pop    %ebx
  800f4c:	5e                   	pop    %esi
  800f4d:	5f                   	pop    %edi
  800f4e:	5d                   	pop    %ebp
  800f4f:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800f50:	83 ec 0c             	sub    $0xc,%esp
  800f53:	50                   	push   %eax
  800f54:	6a 08                	push   $0x8
  800f56:	68 9f 27 80 00       	push   $0x80279f
  800f5b:	6a 23                	push   $0x23
  800f5d:	68 bc 27 80 00       	push   $0x8027bc
  800f62:	e8 e5 f3 ff ff       	call   80034c <_panic>

00800f67 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800f67:	f3 0f 1e fb          	endbr32 
  800f6b:	55                   	push   %ebp
  800f6c:	89 e5                	mov    %esp,%ebp
  800f6e:	57                   	push   %edi
  800f6f:	56                   	push   %esi
  800f70:	53                   	push   %ebx
  800f71:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800f74:	bb 00 00 00 00       	mov    $0x0,%ebx
  800f79:	8b 55 08             	mov    0x8(%ebp),%edx
  800f7c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800f7f:	b8 09 00 00 00       	mov    $0x9,%eax
  800f84:	89 df                	mov    %ebx,%edi
  800f86:	89 de                	mov    %ebx,%esi
  800f88:	cd 30                	int    $0x30
	if(check && ret > 0)
  800f8a:	85 c0                	test   %eax,%eax
  800f8c:	7f 08                	jg     800f96 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800f8e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f91:	5b                   	pop    %ebx
  800f92:	5e                   	pop    %esi
  800f93:	5f                   	pop    %edi
  800f94:	5d                   	pop    %ebp
  800f95:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800f96:	83 ec 0c             	sub    $0xc,%esp
  800f99:	50                   	push   %eax
  800f9a:	6a 09                	push   $0x9
  800f9c:	68 9f 27 80 00       	push   $0x80279f
  800fa1:	6a 23                	push   $0x23
  800fa3:	68 bc 27 80 00       	push   $0x8027bc
  800fa8:	e8 9f f3 ff ff       	call   80034c <_panic>

00800fad <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800fad:	f3 0f 1e fb          	endbr32 
  800fb1:	55                   	push   %ebp
  800fb2:	89 e5                	mov    %esp,%ebp
  800fb4:	57                   	push   %edi
  800fb5:	56                   	push   %esi
  800fb6:	53                   	push   %ebx
  800fb7:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800fba:	bb 00 00 00 00       	mov    $0x0,%ebx
  800fbf:	8b 55 08             	mov    0x8(%ebp),%edx
  800fc2:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800fc5:	b8 0a 00 00 00       	mov    $0xa,%eax
  800fca:	89 df                	mov    %ebx,%edi
  800fcc:	89 de                	mov    %ebx,%esi
  800fce:	cd 30                	int    $0x30
	if(check && ret > 0)
  800fd0:	85 c0                	test   %eax,%eax
  800fd2:	7f 08                	jg     800fdc <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800fd4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800fd7:	5b                   	pop    %ebx
  800fd8:	5e                   	pop    %esi
  800fd9:	5f                   	pop    %edi
  800fda:	5d                   	pop    %ebp
  800fdb:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800fdc:	83 ec 0c             	sub    $0xc,%esp
  800fdf:	50                   	push   %eax
  800fe0:	6a 0a                	push   $0xa
  800fe2:	68 9f 27 80 00       	push   $0x80279f
  800fe7:	6a 23                	push   $0x23
  800fe9:	68 bc 27 80 00       	push   $0x8027bc
  800fee:	e8 59 f3 ff ff       	call   80034c <_panic>

00800ff3 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800ff3:	f3 0f 1e fb          	endbr32 
  800ff7:	55                   	push   %ebp
  800ff8:	89 e5                	mov    %esp,%ebp
  800ffa:	57                   	push   %edi
  800ffb:	56                   	push   %esi
  800ffc:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ffd:	8b 55 08             	mov    0x8(%ebp),%edx
  801000:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801003:	b8 0c 00 00 00       	mov    $0xc,%eax
  801008:	be 00 00 00 00       	mov    $0x0,%esi
  80100d:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801010:	8b 7d 14             	mov    0x14(%ebp),%edi
  801013:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  801015:	5b                   	pop    %ebx
  801016:	5e                   	pop    %esi
  801017:	5f                   	pop    %edi
  801018:	5d                   	pop    %ebp
  801019:	c3                   	ret    

0080101a <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  80101a:	f3 0f 1e fb          	endbr32 
  80101e:	55                   	push   %ebp
  80101f:	89 e5                	mov    %esp,%ebp
  801021:	57                   	push   %edi
  801022:	56                   	push   %esi
  801023:	53                   	push   %ebx
  801024:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  801027:	b9 00 00 00 00       	mov    $0x0,%ecx
  80102c:	8b 55 08             	mov    0x8(%ebp),%edx
  80102f:	b8 0d 00 00 00       	mov    $0xd,%eax
  801034:	89 cb                	mov    %ecx,%ebx
  801036:	89 cf                	mov    %ecx,%edi
  801038:	89 ce                	mov    %ecx,%esi
  80103a:	cd 30                	int    $0x30
	if(check && ret > 0)
  80103c:	85 c0                	test   %eax,%eax
  80103e:	7f 08                	jg     801048 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  801040:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801043:	5b                   	pop    %ebx
  801044:	5e                   	pop    %esi
  801045:	5f                   	pop    %edi
  801046:	5d                   	pop    %ebp
  801047:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  801048:	83 ec 0c             	sub    $0xc,%esp
  80104b:	50                   	push   %eax
  80104c:	6a 0d                	push   $0xd
  80104e:	68 9f 27 80 00       	push   $0x80279f
  801053:	6a 23                	push   $0x23
  801055:	68 bc 27 80 00       	push   $0x8027bc
  80105a:	e8 ed f2 ff ff       	call   80034c <_panic>

0080105f <argstart>:
#include <inc/args.h>
#include <inc/string.h>

void
argstart(int *argc, char **argv, struct Argstate *args)
{
  80105f:	f3 0f 1e fb          	endbr32 
  801063:	55                   	push   %ebp
  801064:	89 e5                	mov    %esp,%ebp
  801066:	8b 55 08             	mov    0x8(%ebp),%edx
  801069:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80106c:	8b 45 10             	mov    0x10(%ebp),%eax
	args->argc = argc;
  80106f:	89 10                	mov    %edx,(%eax)
	args->argv = (const char **) argv;
  801071:	89 48 04             	mov    %ecx,0x4(%eax)
	args->curarg = (*argc > 1 && argv ? "" : 0);
  801074:	83 3a 01             	cmpl   $0x1,(%edx)
  801077:	7e 09                	jle    801082 <argstart+0x23>
  801079:	ba 48 24 80 00       	mov    $0x802448,%edx
  80107e:	85 c9                	test   %ecx,%ecx
  801080:	75 05                	jne    801087 <argstart+0x28>
  801082:	ba 00 00 00 00       	mov    $0x0,%edx
  801087:	89 50 08             	mov    %edx,0x8(%eax)
	args->argvalue = 0;
  80108a:	c7 40 0c 00 00 00 00 	movl   $0x0,0xc(%eax)
}
  801091:	5d                   	pop    %ebp
  801092:	c3                   	ret    

00801093 <argnext>:

int
argnext(struct Argstate *args)
{
  801093:	f3 0f 1e fb          	endbr32 
  801097:	55                   	push   %ebp
  801098:	89 e5                	mov    %esp,%ebp
  80109a:	53                   	push   %ebx
  80109b:	83 ec 04             	sub    $0x4,%esp
  80109e:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int arg;

	args->argvalue = 0;
  8010a1:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)

	// Done processing arguments if args->curarg == 0
	if (args->curarg == 0)
  8010a8:	8b 43 08             	mov    0x8(%ebx),%eax
  8010ab:	85 c0                	test   %eax,%eax
  8010ad:	74 74                	je     801123 <argnext+0x90>
		return -1;

	if (!*args->curarg) {
  8010af:	80 38 00             	cmpb   $0x0,(%eax)
  8010b2:	75 48                	jne    8010fc <argnext+0x69>
		// Need to process the next argument
		// Check for end of argument list
		if (*args->argc == 1
  8010b4:	8b 0b                	mov    (%ebx),%ecx
  8010b6:	83 39 01             	cmpl   $0x1,(%ecx)
  8010b9:	74 5a                	je     801115 <argnext+0x82>
		    || args->argv[1][0] != '-'
  8010bb:	8b 53 04             	mov    0x4(%ebx),%edx
  8010be:	8b 42 04             	mov    0x4(%edx),%eax
  8010c1:	80 38 2d             	cmpb   $0x2d,(%eax)
  8010c4:	75 4f                	jne    801115 <argnext+0x82>
		    || args->argv[1][1] == '\0')
  8010c6:	80 78 01 00          	cmpb   $0x0,0x1(%eax)
  8010ca:	74 49                	je     801115 <argnext+0x82>
			goto endofargs;
		// Shift arguments down one
		args->curarg = args->argv[1] + 1;
  8010cc:	83 c0 01             	add    $0x1,%eax
  8010cf:	89 43 08             	mov    %eax,0x8(%ebx)
		memmove(args->argv + 1, args->argv + 2, sizeof(const char *) * (*args->argc - 1));
  8010d2:	83 ec 04             	sub    $0x4,%esp
  8010d5:	8b 01                	mov    (%ecx),%eax
  8010d7:	8d 04 85 fc ff ff ff 	lea    -0x4(,%eax,4),%eax
  8010de:	50                   	push   %eax
  8010df:	8d 42 08             	lea    0x8(%edx),%eax
  8010e2:	50                   	push   %eax
  8010e3:	83 c2 04             	add    $0x4,%edx
  8010e6:	52                   	push   %edx
  8010e7:	e8 d6 fa ff ff       	call   800bc2 <memmove>
		(*args->argc)--;
  8010ec:	8b 03                	mov    (%ebx),%eax
  8010ee:	83 28 01             	subl   $0x1,(%eax)
		// Check for "--": end of argument list
		if (args->curarg[0] == '-' && args->curarg[1] == '\0')
  8010f1:	8b 43 08             	mov    0x8(%ebx),%eax
  8010f4:	83 c4 10             	add    $0x10,%esp
  8010f7:	80 38 2d             	cmpb   $0x2d,(%eax)
  8010fa:	74 13                	je     80110f <argnext+0x7c>
			goto endofargs;
	}

	arg = (unsigned char) *args->curarg;
  8010fc:	8b 43 08             	mov    0x8(%ebx),%eax
  8010ff:	0f b6 10             	movzbl (%eax),%edx
	args->curarg++;
  801102:	83 c0 01             	add    $0x1,%eax
  801105:	89 43 08             	mov    %eax,0x8(%ebx)
	return arg;

    endofargs:
	args->curarg = 0;
	return -1;
}
  801108:	89 d0                	mov    %edx,%eax
  80110a:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80110d:	c9                   	leave  
  80110e:	c3                   	ret    
		if (args->curarg[0] == '-' && args->curarg[1] == '\0')
  80110f:	80 78 01 00          	cmpb   $0x0,0x1(%eax)
  801113:	75 e7                	jne    8010fc <argnext+0x69>
	args->curarg = 0;
  801115:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
	return -1;
  80111c:	ba ff ff ff ff       	mov    $0xffffffff,%edx
  801121:	eb e5                	jmp    801108 <argnext+0x75>
		return -1;
  801123:	ba ff ff ff ff       	mov    $0xffffffff,%edx
  801128:	eb de                	jmp    801108 <argnext+0x75>

0080112a <argnextvalue>:
	return (char*) (args->argvalue ? args->argvalue : argnextvalue(args));
}

char *
argnextvalue(struct Argstate *args)
{
  80112a:	f3 0f 1e fb          	endbr32 
  80112e:	55                   	push   %ebp
  80112f:	89 e5                	mov    %esp,%ebp
  801131:	53                   	push   %ebx
  801132:	83 ec 04             	sub    $0x4,%esp
  801135:	8b 5d 08             	mov    0x8(%ebp),%ebx
	if (!args->curarg)
  801138:	8b 43 08             	mov    0x8(%ebx),%eax
  80113b:	85 c0                	test   %eax,%eax
  80113d:	74 12                	je     801151 <argnextvalue+0x27>
		return 0;
	if (*args->curarg) {
  80113f:	80 38 00             	cmpb   $0x0,(%eax)
  801142:	74 12                	je     801156 <argnextvalue+0x2c>
		args->argvalue = args->curarg;
  801144:	89 43 0c             	mov    %eax,0xc(%ebx)
		args->curarg = "";
  801147:	c7 43 08 48 24 80 00 	movl   $0x802448,0x8(%ebx)
		(*args->argc)--;
	} else {
		args->argvalue = 0;
		args->curarg = 0;
	}
	return (char*) args->argvalue;
  80114e:	8b 43 0c             	mov    0xc(%ebx),%eax
}
  801151:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801154:	c9                   	leave  
  801155:	c3                   	ret    
	} else if (*args->argc > 1) {
  801156:	8b 13                	mov    (%ebx),%edx
  801158:	83 3a 01             	cmpl   $0x1,(%edx)
  80115b:	7f 10                	jg     80116d <argnextvalue+0x43>
		args->argvalue = 0;
  80115d:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
		args->curarg = 0;
  801164:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
  80116b:	eb e1                	jmp    80114e <argnextvalue+0x24>
		args->argvalue = args->argv[1];
  80116d:	8b 43 04             	mov    0x4(%ebx),%eax
  801170:	8b 48 04             	mov    0x4(%eax),%ecx
  801173:	89 4b 0c             	mov    %ecx,0xc(%ebx)
		memmove(args->argv + 1, args->argv + 2, sizeof(const char *) * (*args->argc - 1));
  801176:	83 ec 04             	sub    $0x4,%esp
  801179:	8b 12                	mov    (%edx),%edx
  80117b:	8d 14 95 fc ff ff ff 	lea    -0x4(,%edx,4),%edx
  801182:	52                   	push   %edx
  801183:	8d 50 08             	lea    0x8(%eax),%edx
  801186:	52                   	push   %edx
  801187:	83 c0 04             	add    $0x4,%eax
  80118a:	50                   	push   %eax
  80118b:	e8 32 fa ff ff       	call   800bc2 <memmove>
		(*args->argc)--;
  801190:	8b 03                	mov    (%ebx),%eax
  801192:	83 28 01             	subl   $0x1,(%eax)
  801195:	83 c4 10             	add    $0x10,%esp
  801198:	eb b4                	jmp    80114e <argnextvalue+0x24>

0080119a <argvalue>:
{
  80119a:	f3 0f 1e fb          	endbr32 
  80119e:	55                   	push   %ebp
  80119f:	89 e5                	mov    %esp,%ebp
  8011a1:	83 ec 08             	sub    $0x8,%esp
  8011a4:	8b 55 08             	mov    0x8(%ebp),%edx
	return (char*) (args->argvalue ? args->argvalue : argnextvalue(args));
  8011a7:	8b 42 0c             	mov    0xc(%edx),%eax
  8011aa:	85 c0                	test   %eax,%eax
  8011ac:	74 02                	je     8011b0 <argvalue+0x16>
}
  8011ae:	c9                   	leave  
  8011af:	c3                   	ret    
	return (char*) (args->argvalue ? args->argvalue : argnextvalue(args));
  8011b0:	83 ec 0c             	sub    $0xc,%esp
  8011b3:	52                   	push   %edx
  8011b4:	e8 71 ff ff ff       	call   80112a <argnextvalue>
  8011b9:	83 c4 10             	add    $0x10,%esp
  8011bc:	eb f0                	jmp    8011ae <argvalue+0x14>

008011be <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  8011be:	f3 0f 1e fb          	endbr32 
  8011c2:	55                   	push   %ebp
  8011c3:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  8011c5:	8b 45 08             	mov    0x8(%ebp),%eax
  8011c8:	05 00 00 00 30       	add    $0x30000000,%eax
  8011cd:	c1 e8 0c             	shr    $0xc,%eax
}
  8011d0:	5d                   	pop    %ebp
  8011d1:	c3                   	ret    

008011d2 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  8011d2:	f3 0f 1e fb          	endbr32 
  8011d6:	55                   	push   %ebp
  8011d7:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  8011d9:	8b 45 08             	mov    0x8(%ebp),%eax
  8011dc:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  8011e1:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  8011e6:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  8011eb:	5d                   	pop    %ebp
  8011ec:	c3                   	ret    

008011ed <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  8011ed:	f3 0f 1e fb          	endbr32 
  8011f1:	55                   	push   %ebp
  8011f2:	89 e5                	mov    %esp,%ebp
  8011f4:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  8011f9:	89 c2                	mov    %eax,%edx
  8011fb:	c1 ea 16             	shr    $0x16,%edx
  8011fe:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  801205:	f6 c2 01             	test   $0x1,%dl
  801208:	74 2d                	je     801237 <fd_alloc+0x4a>
  80120a:	89 c2                	mov    %eax,%edx
  80120c:	c1 ea 0c             	shr    $0xc,%edx
  80120f:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  801216:	f6 c2 01             	test   $0x1,%dl
  801219:	74 1c                	je     801237 <fd_alloc+0x4a>
  80121b:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  801220:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  801225:	75 d2                	jne    8011f9 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  801227:	8b 45 08             	mov    0x8(%ebp),%eax
  80122a:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  801230:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  801235:	eb 0a                	jmp    801241 <fd_alloc+0x54>
			*fd_store = fd;
  801237:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80123a:	89 01                	mov    %eax,(%ecx)
			return 0;
  80123c:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801241:	5d                   	pop    %ebp
  801242:	c3                   	ret    

00801243 <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  801243:	f3 0f 1e fb          	endbr32 
  801247:	55                   	push   %ebp
  801248:	89 e5                	mov    %esp,%ebp
  80124a:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  80124d:	83 f8 1f             	cmp    $0x1f,%eax
  801250:	77 30                	ja     801282 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  801252:	c1 e0 0c             	shl    $0xc,%eax
  801255:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  80125a:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  801260:	f6 c2 01             	test   $0x1,%dl
  801263:	74 24                	je     801289 <fd_lookup+0x46>
  801265:	89 c2                	mov    %eax,%edx
  801267:	c1 ea 0c             	shr    $0xc,%edx
  80126a:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  801271:	f6 c2 01             	test   $0x1,%dl
  801274:	74 1a                	je     801290 <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  801276:	8b 55 0c             	mov    0xc(%ebp),%edx
  801279:	89 02                	mov    %eax,(%edx)
	return 0;
  80127b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801280:	5d                   	pop    %ebp
  801281:	c3                   	ret    
		return -E_INVAL;
  801282:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801287:	eb f7                	jmp    801280 <fd_lookup+0x3d>
		return -E_INVAL;
  801289:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  80128e:	eb f0                	jmp    801280 <fd_lookup+0x3d>
  801290:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801295:	eb e9                	jmp    801280 <fd_lookup+0x3d>

00801297 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  801297:	f3 0f 1e fb          	endbr32 
  80129b:	55                   	push   %ebp
  80129c:	89 e5                	mov    %esp,%ebp
  80129e:	83 ec 08             	sub    $0x8,%esp
  8012a1:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8012a4:	ba 48 28 80 00       	mov    $0x802848,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  8012a9:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  8012ae:	39 08                	cmp    %ecx,(%eax)
  8012b0:	74 33                	je     8012e5 <dev_lookup+0x4e>
  8012b2:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  8012b5:	8b 02                	mov    (%edx),%eax
  8012b7:	85 c0                	test   %eax,%eax
  8012b9:	75 f3                	jne    8012ae <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  8012bb:	a1 20 44 80 00       	mov    0x804420,%eax
  8012c0:	8b 40 48             	mov    0x48(%eax),%eax
  8012c3:	83 ec 04             	sub    $0x4,%esp
  8012c6:	51                   	push   %ecx
  8012c7:	50                   	push   %eax
  8012c8:	68 cc 27 80 00       	push   $0x8027cc
  8012cd:	e8 61 f1 ff ff       	call   800433 <cprintf>
	*dev = 0;
  8012d2:	8b 45 0c             	mov    0xc(%ebp),%eax
  8012d5:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  8012db:	83 c4 10             	add    $0x10,%esp
  8012de:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  8012e3:	c9                   	leave  
  8012e4:	c3                   	ret    
			*dev = devtab[i];
  8012e5:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8012e8:	89 01                	mov    %eax,(%ecx)
			return 0;
  8012ea:	b8 00 00 00 00       	mov    $0x0,%eax
  8012ef:	eb f2                	jmp    8012e3 <dev_lookup+0x4c>

008012f1 <fd_close>:
{
  8012f1:	f3 0f 1e fb          	endbr32 
  8012f5:	55                   	push   %ebp
  8012f6:	89 e5                	mov    %esp,%ebp
  8012f8:	57                   	push   %edi
  8012f9:	56                   	push   %esi
  8012fa:	53                   	push   %ebx
  8012fb:	83 ec 24             	sub    $0x24,%esp
  8012fe:	8b 75 08             	mov    0x8(%ebp),%esi
  801301:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  801304:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  801307:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  801308:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  80130e:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  801311:	50                   	push   %eax
  801312:	e8 2c ff ff ff       	call   801243 <fd_lookup>
  801317:	89 c3                	mov    %eax,%ebx
  801319:	83 c4 10             	add    $0x10,%esp
  80131c:	85 c0                	test   %eax,%eax
  80131e:	78 05                	js     801325 <fd_close+0x34>
	    || fd != fd2)
  801320:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  801323:	74 16                	je     80133b <fd_close+0x4a>
		return (must_exist ? r : 0);
  801325:	89 f8                	mov    %edi,%eax
  801327:	84 c0                	test   %al,%al
  801329:	b8 00 00 00 00       	mov    $0x0,%eax
  80132e:	0f 44 d8             	cmove  %eax,%ebx
}
  801331:	89 d8                	mov    %ebx,%eax
  801333:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801336:	5b                   	pop    %ebx
  801337:	5e                   	pop    %esi
  801338:	5f                   	pop    %edi
  801339:	5d                   	pop    %ebp
  80133a:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  80133b:	83 ec 08             	sub    $0x8,%esp
  80133e:	8d 45 e0             	lea    -0x20(%ebp),%eax
  801341:	50                   	push   %eax
  801342:	ff 36                	pushl  (%esi)
  801344:	e8 4e ff ff ff       	call   801297 <dev_lookup>
  801349:	89 c3                	mov    %eax,%ebx
  80134b:	83 c4 10             	add    $0x10,%esp
  80134e:	85 c0                	test   %eax,%eax
  801350:	78 1a                	js     80136c <fd_close+0x7b>
		if (dev->dev_close)
  801352:	8b 45 e0             	mov    -0x20(%ebp),%eax
  801355:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  801358:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  80135d:	85 c0                	test   %eax,%eax
  80135f:	74 0b                	je     80136c <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  801361:	83 ec 0c             	sub    $0xc,%esp
  801364:	56                   	push   %esi
  801365:	ff d0                	call   *%eax
  801367:	89 c3                	mov    %eax,%ebx
  801369:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  80136c:	83 ec 08             	sub    $0x8,%esp
  80136f:	56                   	push   %esi
  801370:	6a 00                	push   $0x0
  801372:	e8 64 fb ff ff       	call   800edb <sys_page_unmap>
	return r;
  801377:	83 c4 10             	add    $0x10,%esp
  80137a:	eb b5                	jmp    801331 <fd_close+0x40>

0080137c <close>:

int
close(int fdnum)
{
  80137c:	f3 0f 1e fb          	endbr32 
  801380:	55                   	push   %ebp
  801381:	89 e5                	mov    %esp,%ebp
  801383:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801386:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801389:	50                   	push   %eax
  80138a:	ff 75 08             	pushl  0x8(%ebp)
  80138d:	e8 b1 fe ff ff       	call   801243 <fd_lookup>
  801392:	83 c4 10             	add    $0x10,%esp
  801395:	85 c0                	test   %eax,%eax
  801397:	79 02                	jns    80139b <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  801399:	c9                   	leave  
  80139a:	c3                   	ret    
		return fd_close(fd, 1);
  80139b:	83 ec 08             	sub    $0x8,%esp
  80139e:	6a 01                	push   $0x1
  8013a0:	ff 75 f4             	pushl  -0xc(%ebp)
  8013a3:	e8 49 ff ff ff       	call   8012f1 <fd_close>
  8013a8:	83 c4 10             	add    $0x10,%esp
  8013ab:	eb ec                	jmp    801399 <close+0x1d>

008013ad <close_all>:

void
close_all(void)
{
  8013ad:	f3 0f 1e fb          	endbr32 
  8013b1:	55                   	push   %ebp
  8013b2:	89 e5                	mov    %esp,%ebp
  8013b4:	53                   	push   %ebx
  8013b5:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  8013b8:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  8013bd:	83 ec 0c             	sub    $0xc,%esp
  8013c0:	53                   	push   %ebx
  8013c1:	e8 b6 ff ff ff       	call   80137c <close>
	for (i = 0; i < MAXFD; i++)
  8013c6:	83 c3 01             	add    $0x1,%ebx
  8013c9:	83 c4 10             	add    $0x10,%esp
  8013cc:	83 fb 20             	cmp    $0x20,%ebx
  8013cf:	75 ec                	jne    8013bd <close_all+0x10>
}
  8013d1:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8013d4:	c9                   	leave  
  8013d5:	c3                   	ret    

008013d6 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  8013d6:	f3 0f 1e fb          	endbr32 
  8013da:	55                   	push   %ebp
  8013db:	89 e5                	mov    %esp,%ebp
  8013dd:	57                   	push   %edi
  8013de:	56                   	push   %esi
  8013df:	53                   	push   %ebx
  8013e0:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  8013e3:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  8013e6:	50                   	push   %eax
  8013e7:	ff 75 08             	pushl  0x8(%ebp)
  8013ea:	e8 54 fe ff ff       	call   801243 <fd_lookup>
  8013ef:	89 c3                	mov    %eax,%ebx
  8013f1:	83 c4 10             	add    $0x10,%esp
  8013f4:	85 c0                	test   %eax,%eax
  8013f6:	0f 88 81 00 00 00    	js     80147d <dup+0xa7>
		return r;
	close(newfdnum);
  8013fc:	83 ec 0c             	sub    $0xc,%esp
  8013ff:	ff 75 0c             	pushl  0xc(%ebp)
  801402:	e8 75 ff ff ff       	call   80137c <close>

	newfd = INDEX2FD(newfdnum);
  801407:	8b 75 0c             	mov    0xc(%ebp),%esi
  80140a:	c1 e6 0c             	shl    $0xc,%esi
  80140d:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  801413:	83 c4 04             	add    $0x4,%esp
  801416:	ff 75 e4             	pushl  -0x1c(%ebp)
  801419:	e8 b4 fd ff ff       	call   8011d2 <fd2data>
  80141e:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  801420:	89 34 24             	mov    %esi,(%esp)
  801423:	e8 aa fd ff ff       	call   8011d2 <fd2data>
  801428:	83 c4 10             	add    $0x10,%esp
  80142b:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  80142d:	89 d8                	mov    %ebx,%eax
  80142f:	c1 e8 16             	shr    $0x16,%eax
  801432:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801439:	a8 01                	test   $0x1,%al
  80143b:	74 11                	je     80144e <dup+0x78>
  80143d:	89 d8                	mov    %ebx,%eax
  80143f:	c1 e8 0c             	shr    $0xc,%eax
  801442:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801449:	f6 c2 01             	test   $0x1,%dl
  80144c:	75 39                	jne    801487 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  80144e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  801451:	89 d0                	mov    %edx,%eax
  801453:	c1 e8 0c             	shr    $0xc,%eax
  801456:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80145d:	83 ec 0c             	sub    $0xc,%esp
  801460:	25 07 0e 00 00       	and    $0xe07,%eax
  801465:	50                   	push   %eax
  801466:	56                   	push   %esi
  801467:	6a 00                	push   $0x0
  801469:	52                   	push   %edx
  80146a:	6a 00                	push   $0x0
  80146c:	e8 24 fa ff ff       	call   800e95 <sys_page_map>
  801471:	89 c3                	mov    %eax,%ebx
  801473:	83 c4 20             	add    $0x20,%esp
  801476:	85 c0                	test   %eax,%eax
  801478:	78 31                	js     8014ab <dup+0xd5>
		goto err;

	return newfdnum;
  80147a:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  80147d:	89 d8                	mov    %ebx,%eax
  80147f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801482:	5b                   	pop    %ebx
  801483:	5e                   	pop    %esi
  801484:	5f                   	pop    %edi
  801485:	5d                   	pop    %ebp
  801486:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  801487:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80148e:	83 ec 0c             	sub    $0xc,%esp
  801491:	25 07 0e 00 00       	and    $0xe07,%eax
  801496:	50                   	push   %eax
  801497:	57                   	push   %edi
  801498:	6a 00                	push   $0x0
  80149a:	53                   	push   %ebx
  80149b:	6a 00                	push   $0x0
  80149d:	e8 f3 f9 ff ff       	call   800e95 <sys_page_map>
  8014a2:	89 c3                	mov    %eax,%ebx
  8014a4:	83 c4 20             	add    $0x20,%esp
  8014a7:	85 c0                	test   %eax,%eax
  8014a9:	79 a3                	jns    80144e <dup+0x78>
	sys_page_unmap(0, newfd);
  8014ab:	83 ec 08             	sub    $0x8,%esp
  8014ae:	56                   	push   %esi
  8014af:	6a 00                	push   $0x0
  8014b1:	e8 25 fa ff ff       	call   800edb <sys_page_unmap>
	sys_page_unmap(0, nva);
  8014b6:	83 c4 08             	add    $0x8,%esp
  8014b9:	57                   	push   %edi
  8014ba:	6a 00                	push   $0x0
  8014bc:	e8 1a fa ff ff       	call   800edb <sys_page_unmap>
	return r;
  8014c1:	83 c4 10             	add    $0x10,%esp
  8014c4:	eb b7                	jmp    80147d <dup+0xa7>

008014c6 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8014c6:	f3 0f 1e fb          	endbr32 
  8014ca:	55                   	push   %ebp
  8014cb:	89 e5                	mov    %esp,%ebp
  8014cd:	53                   	push   %ebx
  8014ce:	83 ec 1c             	sub    $0x1c,%esp
  8014d1:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8014d4:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8014d7:	50                   	push   %eax
  8014d8:	53                   	push   %ebx
  8014d9:	e8 65 fd ff ff       	call   801243 <fd_lookup>
  8014de:	83 c4 10             	add    $0x10,%esp
  8014e1:	85 c0                	test   %eax,%eax
  8014e3:	78 3f                	js     801524 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8014e5:	83 ec 08             	sub    $0x8,%esp
  8014e8:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8014eb:	50                   	push   %eax
  8014ec:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8014ef:	ff 30                	pushl  (%eax)
  8014f1:	e8 a1 fd ff ff       	call   801297 <dev_lookup>
  8014f6:	83 c4 10             	add    $0x10,%esp
  8014f9:	85 c0                	test   %eax,%eax
  8014fb:	78 27                	js     801524 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8014fd:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801500:	8b 42 08             	mov    0x8(%edx),%eax
  801503:	83 e0 03             	and    $0x3,%eax
  801506:	83 f8 01             	cmp    $0x1,%eax
  801509:	74 1e                	je     801529 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  80150b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80150e:	8b 40 08             	mov    0x8(%eax),%eax
  801511:	85 c0                	test   %eax,%eax
  801513:	74 35                	je     80154a <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  801515:	83 ec 04             	sub    $0x4,%esp
  801518:	ff 75 10             	pushl  0x10(%ebp)
  80151b:	ff 75 0c             	pushl  0xc(%ebp)
  80151e:	52                   	push   %edx
  80151f:	ff d0                	call   *%eax
  801521:	83 c4 10             	add    $0x10,%esp
}
  801524:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801527:	c9                   	leave  
  801528:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  801529:	a1 20 44 80 00       	mov    0x804420,%eax
  80152e:	8b 40 48             	mov    0x48(%eax),%eax
  801531:	83 ec 04             	sub    $0x4,%esp
  801534:	53                   	push   %ebx
  801535:	50                   	push   %eax
  801536:	68 0d 28 80 00       	push   $0x80280d
  80153b:	e8 f3 ee ff ff       	call   800433 <cprintf>
		return -E_INVAL;
  801540:	83 c4 10             	add    $0x10,%esp
  801543:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801548:	eb da                	jmp    801524 <read+0x5e>
		return -E_NOT_SUPP;
  80154a:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80154f:	eb d3                	jmp    801524 <read+0x5e>

00801551 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  801551:	f3 0f 1e fb          	endbr32 
  801555:	55                   	push   %ebp
  801556:	89 e5                	mov    %esp,%ebp
  801558:	57                   	push   %edi
  801559:	56                   	push   %esi
  80155a:	53                   	push   %ebx
  80155b:	83 ec 0c             	sub    $0xc,%esp
  80155e:	8b 7d 08             	mov    0x8(%ebp),%edi
  801561:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  801564:	bb 00 00 00 00       	mov    $0x0,%ebx
  801569:	eb 02                	jmp    80156d <readn+0x1c>
  80156b:	01 c3                	add    %eax,%ebx
  80156d:	39 f3                	cmp    %esi,%ebx
  80156f:	73 21                	jae    801592 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801571:	83 ec 04             	sub    $0x4,%esp
  801574:	89 f0                	mov    %esi,%eax
  801576:	29 d8                	sub    %ebx,%eax
  801578:	50                   	push   %eax
  801579:	89 d8                	mov    %ebx,%eax
  80157b:	03 45 0c             	add    0xc(%ebp),%eax
  80157e:	50                   	push   %eax
  80157f:	57                   	push   %edi
  801580:	e8 41 ff ff ff       	call   8014c6 <read>
		if (m < 0)
  801585:	83 c4 10             	add    $0x10,%esp
  801588:	85 c0                	test   %eax,%eax
  80158a:	78 04                	js     801590 <readn+0x3f>
			return m;
		if (m == 0)
  80158c:	75 dd                	jne    80156b <readn+0x1a>
  80158e:	eb 02                	jmp    801592 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801590:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  801592:	89 d8                	mov    %ebx,%eax
  801594:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801597:	5b                   	pop    %ebx
  801598:	5e                   	pop    %esi
  801599:	5f                   	pop    %edi
  80159a:	5d                   	pop    %ebp
  80159b:	c3                   	ret    

0080159c <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  80159c:	f3 0f 1e fb          	endbr32 
  8015a0:	55                   	push   %ebp
  8015a1:	89 e5                	mov    %esp,%ebp
  8015a3:	53                   	push   %ebx
  8015a4:	83 ec 1c             	sub    $0x1c,%esp
  8015a7:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8015aa:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8015ad:	50                   	push   %eax
  8015ae:	53                   	push   %ebx
  8015af:	e8 8f fc ff ff       	call   801243 <fd_lookup>
  8015b4:	83 c4 10             	add    $0x10,%esp
  8015b7:	85 c0                	test   %eax,%eax
  8015b9:	78 3a                	js     8015f5 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8015bb:	83 ec 08             	sub    $0x8,%esp
  8015be:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8015c1:	50                   	push   %eax
  8015c2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8015c5:	ff 30                	pushl  (%eax)
  8015c7:	e8 cb fc ff ff       	call   801297 <dev_lookup>
  8015cc:	83 c4 10             	add    $0x10,%esp
  8015cf:	85 c0                	test   %eax,%eax
  8015d1:	78 22                	js     8015f5 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8015d3:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8015d6:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8015da:	74 1e                	je     8015fa <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8015dc:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8015df:	8b 52 0c             	mov    0xc(%edx),%edx
  8015e2:	85 d2                	test   %edx,%edx
  8015e4:	74 35                	je     80161b <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  8015e6:	83 ec 04             	sub    $0x4,%esp
  8015e9:	ff 75 10             	pushl  0x10(%ebp)
  8015ec:	ff 75 0c             	pushl  0xc(%ebp)
  8015ef:	50                   	push   %eax
  8015f0:	ff d2                	call   *%edx
  8015f2:	83 c4 10             	add    $0x10,%esp
}
  8015f5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8015f8:	c9                   	leave  
  8015f9:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  8015fa:	a1 20 44 80 00       	mov    0x804420,%eax
  8015ff:	8b 40 48             	mov    0x48(%eax),%eax
  801602:	83 ec 04             	sub    $0x4,%esp
  801605:	53                   	push   %ebx
  801606:	50                   	push   %eax
  801607:	68 29 28 80 00       	push   $0x802829
  80160c:	e8 22 ee ff ff       	call   800433 <cprintf>
		return -E_INVAL;
  801611:	83 c4 10             	add    $0x10,%esp
  801614:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801619:	eb da                	jmp    8015f5 <write+0x59>
		return -E_NOT_SUPP;
  80161b:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801620:	eb d3                	jmp    8015f5 <write+0x59>

00801622 <seek>:

int
seek(int fdnum, off_t offset)
{
  801622:	f3 0f 1e fb          	endbr32 
  801626:	55                   	push   %ebp
  801627:	89 e5                	mov    %esp,%ebp
  801629:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80162c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80162f:	50                   	push   %eax
  801630:	ff 75 08             	pushl  0x8(%ebp)
  801633:	e8 0b fc ff ff       	call   801243 <fd_lookup>
  801638:	83 c4 10             	add    $0x10,%esp
  80163b:	85 c0                	test   %eax,%eax
  80163d:	78 0e                	js     80164d <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  80163f:	8b 55 0c             	mov    0xc(%ebp),%edx
  801642:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801645:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801648:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80164d:	c9                   	leave  
  80164e:	c3                   	ret    

0080164f <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  80164f:	f3 0f 1e fb          	endbr32 
  801653:	55                   	push   %ebp
  801654:	89 e5                	mov    %esp,%ebp
  801656:	53                   	push   %ebx
  801657:	83 ec 1c             	sub    $0x1c,%esp
  80165a:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  80165d:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801660:	50                   	push   %eax
  801661:	53                   	push   %ebx
  801662:	e8 dc fb ff ff       	call   801243 <fd_lookup>
  801667:	83 c4 10             	add    $0x10,%esp
  80166a:	85 c0                	test   %eax,%eax
  80166c:	78 37                	js     8016a5 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80166e:	83 ec 08             	sub    $0x8,%esp
  801671:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801674:	50                   	push   %eax
  801675:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801678:	ff 30                	pushl  (%eax)
  80167a:	e8 18 fc ff ff       	call   801297 <dev_lookup>
  80167f:	83 c4 10             	add    $0x10,%esp
  801682:	85 c0                	test   %eax,%eax
  801684:	78 1f                	js     8016a5 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  801686:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801689:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  80168d:	74 1b                	je     8016aa <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  80168f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801692:	8b 52 18             	mov    0x18(%edx),%edx
  801695:	85 d2                	test   %edx,%edx
  801697:	74 32                	je     8016cb <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  801699:	83 ec 08             	sub    $0x8,%esp
  80169c:	ff 75 0c             	pushl  0xc(%ebp)
  80169f:	50                   	push   %eax
  8016a0:	ff d2                	call   *%edx
  8016a2:	83 c4 10             	add    $0x10,%esp
}
  8016a5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8016a8:	c9                   	leave  
  8016a9:	c3                   	ret    
			thisenv->env_id, fdnum);
  8016aa:	a1 20 44 80 00       	mov    0x804420,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  8016af:	8b 40 48             	mov    0x48(%eax),%eax
  8016b2:	83 ec 04             	sub    $0x4,%esp
  8016b5:	53                   	push   %ebx
  8016b6:	50                   	push   %eax
  8016b7:	68 ec 27 80 00       	push   $0x8027ec
  8016bc:	e8 72 ed ff ff       	call   800433 <cprintf>
		return -E_INVAL;
  8016c1:	83 c4 10             	add    $0x10,%esp
  8016c4:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8016c9:	eb da                	jmp    8016a5 <ftruncate+0x56>
		return -E_NOT_SUPP;
  8016cb:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8016d0:	eb d3                	jmp    8016a5 <ftruncate+0x56>

008016d2 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8016d2:	f3 0f 1e fb          	endbr32 
  8016d6:	55                   	push   %ebp
  8016d7:	89 e5                	mov    %esp,%ebp
  8016d9:	53                   	push   %ebx
  8016da:	83 ec 1c             	sub    $0x1c,%esp
  8016dd:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8016e0:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8016e3:	50                   	push   %eax
  8016e4:	ff 75 08             	pushl  0x8(%ebp)
  8016e7:	e8 57 fb ff ff       	call   801243 <fd_lookup>
  8016ec:	83 c4 10             	add    $0x10,%esp
  8016ef:	85 c0                	test   %eax,%eax
  8016f1:	78 4b                	js     80173e <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8016f3:	83 ec 08             	sub    $0x8,%esp
  8016f6:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8016f9:	50                   	push   %eax
  8016fa:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8016fd:	ff 30                	pushl  (%eax)
  8016ff:	e8 93 fb ff ff       	call   801297 <dev_lookup>
  801704:	83 c4 10             	add    $0x10,%esp
  801707:	85 c0                	test   %eax,%eax
  801709:	78 33                	js     80173e <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  80170b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80170e:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  801712:	74 2f                	je     801743 <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  801714:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  801717:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  80171e:	00 00 00 
	stat->st_isdir = 0;
  801721:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801728:	00 00 00 
	stat->st_dev = dev;
  80172b:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  801731:	83 ec 08             	sub    $0x8,%esp
  801734:	53                   	push   %ebx
  801735:	ff 75 f0             	pushl  -0x10(%ebp)
  801738:	ff 50 14             	call   *0x14(%eax)
  80173b:	83 c4 10             	add    $0x10,%esp
}
  80173e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801741:	c9                   	leave  
  801742:	c3                   	ret    
		return -E_NOT_SUPP;
  801743:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801748:	eb f4                	jmp    80173e <fstat+0x6c>

0080174a <stat>:

int
stat(const char *path, struct Stat *stat)
{
  80174a:	f3 0f 1e fb          	endbr32 
  80174e:	55                   	push   %ebp
  80174f:	89 e5                	mov    %esp,%ebp
  801751:	56                   	push   %esi
  801752:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  801753:	83 ec 08             	sub    $0x8,%esp
  801756:	6a 00                	push   $0x0
  801758:	ff 75 08             	pushl  0x8(%ebp)
  80175b:	e8 fb 01 00 00       	call   80195b <open>
  801760:	89 c3                	mov    %eax,%ebx
  801762:	83 c4 10             	add    $0x10,%esp
  801765:	85 c0                	test   %eax,%eax
  801767:	78 1b                	js     801784 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  801769:	83 ec 08             	sub    $0x8,%esp
  80176c:	ff 75 0c             	pushl  0xc(%ebp)
  80176f:	50                   	push   %eax
  801770:	e8 5d ff ff ff       	call   8016d2 <fstat>
  801775:	89 c6                	mov    %eax,%esi
	close(fd);
  801777:	89 1c 24             	mov    %ebx,(%esp)
  80177a:	e8 fd fb ff ff       	call   80137c <close>
	return r;
  80177f:	83 c4 10             	add    $0x10,%esp
  801782:	89 f3                	mov    %esi,%ebx
}
  801784:	89 d8                	mov    %ebx,%eax
  801786:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801789:	5b                   	pop    %ebx
  80178a:	5e                   	pop    %esi
  80178b:	5d                   	pop    %ebp
  80178c:	c3                   	ret    

0080178d <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  80178d:	55                   	push   %ebp
  80178e:	89 e5                	mov    %esp,%ebp
  801790:	56                   	push   %esi
  801791:	53                   	push   %ebx
  801792:	89 c6                	mov    %eax,%esi
  801794:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  801796:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  80179d:	74 27                	je     8017c6 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  80179f:	6a 07                	push   $0x7
  8017a1:	68 00 50 80 00       	push   $0x805000
  8017a6:	56                   	push   %esi
  8017a7:	ff 35 00 40 80 00    	pushl  0x804000
  8017ad:	e8 f6 08 00 00       	call   8020a8 <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  8017b2:	83 c4 0c             	add    $0xc,%esp
  8017b5:	6a 00                	push   $0x0
  8017b7:	53                   	push   %ebx
  8017b8:	6a 00                	push   $0x0
  8017ba:	e8 68 08 00 00       	call   802027 <ipc_recv>
}
  8017bf:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8017c2:	5b                   	pop    %ebx
  8017c3:	5e                   	pop    %esi
  8017c4:	5d                   	pop    %ebp
  8017c5:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8017c6:	83 ec 0c             	sub    $0xc,%esp
  8017c9:	6a 01                	push   $0x1
  8017cb:	e8 30 09 00 00       	call   802100 <ipc_find_env>
  8017d0:	a3 00 40 80 00       	mov    %eax,0x804000
  8017d5:	83 c4 10             	add    $0x10,%esp
  8017d8:	eb c5                	jmp    80179f <fsipc+0x12>

008017da <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8017da:	f3 0f 1e fb          	endbr32 
  8017de:	55                   	push   %ebp
  8017df:	89 e5                	mov    %esp,%ebp
  8017e1:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8017e4:	8b 45 08             	mov    0x8(%ebp),%eax
  8017e7:	8b 40 0c             	mov    0xc(%eax),%eax
  8017ea:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  8017ef:	8b 45 0c             	mov    0xc(%ebp),%eax
  8017f2:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  8017f7:	ba 00 00 00 00       	mov    $0x0,%edx
  8017fc:	b8 02 00 00 00       	mov    $0x2,%eax
  801801:	e8 87 ff ff ff       	call   80178d <fsipc>
}
  801806:	c9                   	leave  
  801807:	c3                   	ret    

00801808 <devfile_flush>:
{
  801808:	f3 0f 1e fb          	endbr32 
  80180c:	55                   	push   %ebp
  80180d:	89 e5                	mov    %esp,%ebp
  80180f:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  801812:	8b 45 08             	mov    0x8(%ebp),%eax
  801815:	8b 40 0c             	mov    0xc(%eax),%eax
  801818:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  80181d:	ba 00 00 00 00       	mov    $0x0,%edx
  801822:	b8 06 00 00 00       	mov    $0x6,%eax
  801827:	e8 61 ff ff ff       	call   80178d <fsipc>
}
  80182c:	c9                   	leave  
  80182d:	c3                   	ret    

0080182e <devfile_stat>:
{
  80182e:	f3 0f 1e fb          	endbr32 
  801832:	55                   	push   %ebp
  801833:	89 e5                	mov    %esp,%ebp
  801835:	53                   	push   %ebx
  801836:	83 ec 04             	sub    $0x4,%esp
  801839:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  80183c:	8b 45 08             	mov    0x8(%ebp),%eax
  80183f:	8b 40 0c             	mov    0xc(%eax),%eax
  801842:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801847:	ba 00 00 00 00       	mov    $0x0,%edx
  80184c:	b8 05 00 00 00       	mov    $0x5,%eax
  801851:	e8 37 ff ff ff       	call   80178d <fsipc>
  801856:	85 c0                	test   %eax,%eax
  801858:	78 2c                	js     801886 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  80185a:	83 ec 08             	sub    $0x8,%esp
  80185d:	68 00 50 80 00       	push   $0x805000
  801862:	53                   	push   %ebx
  801863:	e8 a4 f1 ff ff       	call   800a0c <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  801868:	a1 80 50 80 00       	mov    0x805080,%eax
  80186d:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  801873:	a1 84 50 80 00       	mov    0x805084,%eax
  801878:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  80187e:	83 c4 10             	add    $0x10,%esp
  801881:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801886:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801889:	c9                   	leave  
  80188a:	c3                   	ret    

0080188b <devfile_write>:
{
  80188b:	f3 0f 1e fb          	endbr32 
  80188f:	55                   	push   %ebp
  801890:	89 e5                	mov    %esp,%ebp
  801892:	83 ec 0c             	sub    $0xc,%esp
  801895:	8b 45 10             	mov    0x10(%ebp),%eax
  801898:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  80189d:	ba f8 0f 00 00       	mov    $0xff8,%edx
  8018a2:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  8018a5:	8b 55 08             	mov    0x8(%ebp),%edx
  8018a8:	8b 52 0c             	mov    0xc(%edx),%edx
  8018ab:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  8018b1:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  8018b6:	50                   	push   %eax
  8018b7:	ff 75 0c             	pushl  0xc(%ebp)
  8018ba:	68 08 50 80 00       	push   $0x805008
  8018bf:	e8 fe f2 ff ff       	call   800bc2 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8018c4:	ba 00 00 00 00       	mov    $0x0,%edx
  8018c9:	b8 04 00 00 00       	mov    $0x4,%eax
  8018ce:	e8 ba fe ff ff       	call   80178d <fsipc>
  8018d3:	c9                   	leave  
  8018d4:	c3                   	ret    

008018d5 <devfile_read>:
{
  8018d5:	f3 0f 1e fb          	endbr32 
  8018d9:	55                   	push   %ebp
  8018da:	89 e5                	mov    %esp,%ebp
  8018dc:	56                   	push   %esi
  8018dd:	53                   	push   %ebx
  8018de:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  8018e1:	8b 45 08             	mov    0x8(%ebp),%eax
  8018e4:	8b 40 0c             	mov    0xc(%eax),%eax
  8018e7:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  8018ec:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  8018f2:	ba 00 00 00 00       	mov    $0x0,%edx
  8018f7:	b8 03 00 00 00       	mov    $0x3,%eax
  8018fc:	e8 8c fe ff ff       	call   80178d <fsipc>
  801901:	89 c3                	mov    %eax,%ebx
  801903:	85 c0                	test   %eax,%eax
  801905:	78 1f                	js     801926 <devfile_read+0x51>
	assert(r <= n);
  801907:	39 f0                	cmp    %esi,%eax
  801909:	77 24                	ja     80192f <devfile_read+0x5a>
	assert(r <= PGSIZE);
  80190b:	3d 00 10 00 00       	cmp    $0x1000,%eax
  801910:	7f 33                	jg     801945 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  801912:	83 ec 04             	sub    $0x4,%esp
  801915:	50                   	push   %eax
  801916:	68 00 50 80 00       	push   $0x805000
  80191b:	ff 75 0c             	pushl  0xc(%ebp)
  80191e:	e8 9f f2 ff ff       	call   800bc2 <memmove>
	return r;
  801923:	83 c4 10             	add    $0x10,%esp
}
  801926:	89 d8                	mov    %ebx,%eax
  801928:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80192b:	5b                   	pop    %ebx
  80192c:	5e                   	pop    %esi
  80192d:	5d                   	pop    %ebp
  80192e:	c3                   	ret    
	assert(r <= n);
  80192f:	68 58 28 80 00       	push   $0x802858
  801934:	68 5f 28 80 00       	push   $0x80285f
  801939:	6a 7c                	push   $0x7c
  80193b:	68 74 28 80 00       	push   $0x802874
  801940:	e8 07 ea ff ff       	call   80034c <_panic>
	assert(r <= PGSIZE);
  801945:	68 7f 28 80 00       	push   $0x80287f
  80194a:	68 5f 28 80 00       	push   $0x80285f
  80194f:	6a 7d                	push   $0x7d
  801951:	68 74 28 80 00       	push   $0x802874
  801956:	e8 f1 e9 ff ff       	call   80034c <_panic>

0080195b <open>:
{
  80195b:	f3 0f 1e fb          	endbr32 
  80195f:	55                   	push   %ebp
  801960:	89 e5                	mov    %esp,%ebp
  801962:	56                   	push   %esi
  801963:	53                   	push   %ebx
  801964:	83 ec 1c             	sub    $0x1c,%esp
  801967:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  80196a:	56                   	push   %esi
  80196b:	e8 59 f0 ff ff       	call   8009c9 <strlen>
  801970:	83 c4 10             	add    $0x10,%esp
  801973:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  801978:	7f 6c                	jg     8019e6 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  80197a:	83 ec 0c             	sub    $0xc,%esp
  80197d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801980:	50                   	push   %eax
  801981:	e8 67 f8 ff ff       	call   8011ed <fd_alloc>
  801986:	89 c3                	mov    %eax,%ebx
  801988:	83 c4 10             	add    $0x10,%esp
  80198b:	85 c0                	test   %eax,%eax
  80198d:	78 3c                	js     8019cb <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  80198f:	83 ec 08             	sub    $0x8,%esp
  801992:	56                   	push   %esi
  801993:	68 00 50 80 00       	push   $0x805000
  801998:	e8 6f f0 ff ff       	call   800a0c <strcpy>
	fsipcbuf.open.req_omode = mode;
  80199d:	8b 45 0c             	mov    0xc(%ebp),%eax
  8019a0:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  8019a5:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8019a8:	b8 01 00 00 00       	mov    $0x1,%eax
  8019ad:	e8 db fd ff ff       	call   80178d <fsipc>
  8019b2:	89 c3                	mov    %eax,%ebx
  8019b4:	83 c4 10             	add    $0x10,%esp
  8019b7:	85 c0                	test   %eax,%eax
  8019b9:	78 19                	js     8019d4 <open+0x79>
	return fd2num(fd);
  8019bb:	83 ec 0c             	sub    $0xc,%esp
  8019be:	ff 75 f4             	pushl  -0xc(%ebp)
  8019c1:	e8 f8 f7 ff ff       	call   8011be <fd2num>
  8019c6:	89 c3                	mov    %eax,%ebx
  8019c8:	83 c4 10             	add    $0x10,%esp
}
  8019cb:	89 d8                	mov    %ebx,%eax
  8019cd:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8019d0:	5b                   	pop    %ebx
  8019d1:	5e                   	pop    %esi
  8019d2:	5d                   	pop    %ebp
  8019d3:	c3                   	ret    
		fd_close(fd, 0);
  8019d4:	83 ec 08             	sub    $0x8,%esp
  8019d7:	6a 00                	push   $0x0
  8019d9:	ff 75 f4             	pushl  -0xc(%ebp)
  8019dc:	e8 10 f9 ff ff       	call   8012f1 <fd_close>
		return r;
  8019e1:	83 c4 10             	add    $0x10,%esp
  8019e4:	eb e5                	jmp    8019cb <open+0x70>
		return -E_BAD_PATH;
  8019e6:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  8019eb:	eb de                	jmp    8019cb <open+0x70>

008019ed <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  8019ed:	f3 0f 1e fb          	endbr32 
  8019f1:	55                   	push   %ebp
  8019f2:	89 e5                	mov    %esp,%ebp
  8019f4:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  8019f7:	ba 00 00 00 00       	mov    $0x0,%edx
  8019fc:	b8 08 00 00 00       	mov    $0x8,%eax
  801a01:	e8 87 fd ff ff       	call   80178d <fsipc>
}
  801a06:	c9                   	leave  
  801a07:	c3                   	ret    

00801a08 <writebuf>:


static void
writebuf(struct printbuf *b)
{
	if (b->error > 0) {
  801a08:	83 78 0c 00          	cmpl   $0x0,0xc(%eax)
  801a0c:	7f 01                	jg     801a0f <writebuf+0x7>
  801a0e:	c3                   	ret    
{
  801a0f:	55                   	push   %ebp
  801a10:	89 e5                	mov    %esp,%ebp
  801a12:	53                   	push   %ebx
  801a13:	83 ec 08             	sub    $0x8,%esp
  801a16:	89 c3                	mov    %eax,%ebx
		ssize_t result = write(b->fd, b->buf, b->idx);
  801a18:	ff 70 04             	pushl  0x4(%eax)
  801a1b:	8d 40 10             	lea    0x10(%eax),%eax
  801a1e:	50                   	push   %eax
  801a1f:	ff 33                	pushl  (%ebx)
  801a21:	e8 76 fb ff ff       	call   80159c <write>
		if (result > 0)
  801a26:	83 c4 10             	add    $0x10,%esp
  801a29:	85 c0                	test   %eax,%eax
  801a2b:	7e 03                	jle    801a30 <writebuf+0x28>
			b->result += result;
  801a2d:	01 43 08             	add    %eax,0x8(%ebx)
		if (result != b->idx) // error, or wrote less than supplied
  801a30:	39 43 04             	cmp    %eax,0x4(%ebx)
  801a33:	74 0d                	je     801a42 <writebuf+0x3a>
			b->error = (result < 0 ? result : 0);
  801a35:	85 c0                	test   %eax,%eax
  801a37:	ba 00 00 00 00       	mov    $0x0,%edx
  801a3c:	0f 4f c2             	cmovg  %edx,%eax
  801a3f:	89 43 0c             	mov    %eax,0xc(%ebx)
	}
}
  801a42:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801a45:	c9                   	leave  
  801a46:	c3                   	ret    

00801a47 <putch>:

static void
putch(int ch, void *thunk)
{
  801a47:	f3 0f 1e fb          	endbr32 
  801a4b:	55                   	push   %ebp
  801a4c:	89 e5                	mov    %esp,%ebp
  801a4e:	53                   	push   %ebx
  801a4f:	83 ec 04             	sub    $0x4,%esp
  801a52:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct printbuf *b = (struct printbuf *) thunk;
	b->buf[b->idx++] = ch;
  801a55:	8b 53 04             	mov    0x4(%ebx),%edx
  801a58:	8d 42 01             	lea    0x1(%edx),%eax
  801a5b:	89 43 04             	mov    %eax,0x4(%ebx)
  801a5e:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801a61:	88 4c 13 10          	mov    %cl,0x10(%ebx,%edx,1)
	if (b->idx == 256) {
  801a65:	3d 00 01 00 00       	cmp    $0x100,%eax
  801a6a:	74 06                	je     801a72 <putch+0x2b>
		writebuf(b);
		b->idx = 0;
	}
}
  801a6c:	83 c4 04             	add    $0x4,%esp
  801a6f:	5b                   	pop    %ebx
  801a70:	5d                   	pop    %ebp
  801a71:	c3                   	ret    
		writebuf(b);
  801a72:	89 d8                	mov    %ebx,%eax
  801a74:	e8 8f ff ff ff       	call   801a08 <writebuf>
		b->idx = 0;
  801a79:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
}
  801a80:	eb ea                	jmp    801a6c <putch+0x25>

00801a82 <vfprintf>:

int
vfprintf(int fd, const char *fmt, va_list ap)
{
  801a82:	f3 0f 1e fb          	endbr32 
  801a86:	55                   	push   %ebp
  801a87:	89 e5                	mov    %esp,%ebp
  801a89:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.fd = fd;
  801a8f:	8b 45 08             	mov    0x8(%ebp),%eax
  801a92:	89 85 e8 fe ff ff    	mov    %eax,-0x118(%ebp)
	b.idx = 0;
  801a98:	c7 85 ec fe ff ff 00 	movl   $0x0,-0x114(%ebp)
  801a9f:	00 00 00 
	b.result = 0;
  801aa2:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  801aa9:	00 00 00 
	b.error = 1;
  801aac:	c7 85 f4 fe ff ff 01 	movl   $0x1,-0x10c(%ebp)
  801ab3:	00 00 00 
	vprintfmt(putch, &b, fmt, ap);
  801ab6:	ff 75 10             	pushl  0x10(%ebp)
  801ab9:	ff 75 0c             	pushl  0xc(%ebp)
  801abc:	8d 85 e8 fe ff ff    	lea    -0x118(%ebp),%eax
  801ac2:	50                   	push   %eax
  801ac3:	68 47 1a 80 00       	push   $0x801a47
  801ac8:	e8 69 ea ff ff       	call   800536 <vprintfmt>
	if (b.idx > 0)
  801acd:	83 c4 10             	add    $0x10,%esp
  801ad0:	83 bd ec fe ff ff 00 	cmpl   $0x0,-0x114(%ebp)
  801ad7:	7f 11                	jg     801aea <vfprintf+0x68>
		writebuf(&b);

	return (b.result ? b.result : b.error);
  801ad9:	8b 85 f0 fe ff ff    	mov    -0x110(%ebp),%eax
  801adf:	85 c0                	test   %eax,%eax
  801ae1:	0f 44 85 f4 fe ff ff 	cmove  -0x10c(%ebp),%eax
}
  801ae8:	c9                   	leave  
  801ae9:	c3                   	ret    
		writebuf(&b);
  801aea:	8d 85 e8 fe ff ff    	lea    -0x118(%ebp),%eax
  801af0:	e8 13 ff ff ff       	call   801a08 <writebuf>
  801af5:	eb e2                	jmp    801ad9 <vfprintf+0x57>

00801af7 <fprintf>:

int
fprintf(int fd, const char *fmt, ...)
{
  801af7:	f3 0f 1e fb          	endbr32 
  801afb:	55                   	push   %ebp
  801afc:	89 e5                	mov    %esp,%ebp
  801afe:	83 ec 0c             	sub    $0xc,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  801b01:	8d 45 10             	lea    0x10(%ebp),%eax
	cnt = vfprintf(fd, fmt, ap);
  801b04:	50                   	push   %eax
  801b05:	ff 75 0c             	pushl  0xc(%ebp)
  801b08:	ff 75 08             	pushl  0x8(%ebp)
  801b0b:	e8 72 ff ff ff       	call   801a82 <vfprintf>
	va_end(ap);

	return cnt;
}
  801b10:	c9                   	leave  
  801b11:	c3                   	ret    

00801b12 <printf>:

int
printf(const char *fmt, ...)
{
  801b12:	f3 0f 1e fb          	endbr32 
  801b16:	55                   	push   %ebp
  801b17:	89 e5                	mov    %esp,%ebp
  801b19:	83 ec 0c             	sub    $0xc,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  801b1c:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vfprintf(1, fmt, ap);
  801b1f:	50                   	push   %eax
  801b20:	ff 75 08             	pushl  0x8(%ebp)
  801b23:	6a 01                	push   $0x1
  801b25:	e8 58 ff ff ff       	call   801a82 <vfprintf>
	va_end(ap);

	return cnt;
}
  801b2a:	c9                   	leave  
  801b2b:	c3                   	ret    

00801b2c <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  801b2c:	f3 0f 1e fb          	endbr32 
  801b30:	55                   	push   %ebp
  801b31:	89 e5                	mov    %esp,%ebp
  801b33:	56                   	push   %esi
  801b34:	53                   	push   %ebx
  801b35:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  801b38:	83 ec 0c             	sub    $0xc,%esp
  801b3b:	ff 75 08             	pushl  0x8(%ebp)
  801b3e:	e8 8f f6 ff ff       	call   8011d2 <fd2data>
  801b43:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801b45:	83 c4 08             	add    $0x8,%esp
  801b48:	68 8b 28 80 00       	push   $0x80288b
  801b4d:	53                   	push   %ebx
  801b4e:	e8 b9 ee ff ff       	call   800a0c <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  801b53:	8b 46 04             	mov    0x4(%esi),%eax
  801b56:	2b 06                	sub    (%esi),%eax
  801b58:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  801b5e:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801b65:	00 00 00 
	stat->st_dev = &devpipe;
  801b68:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  801b6f:	30 80 00 
	return 0;
}
  801b72:	b8 00 00 00 00       	mov    $0x0,%eax
  801b77:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801b7a:	5b                   	pop    %ebx
  801b7b:	5e                   	pop    %esi
  801b7c:	5d                   	pop    %ebp
  801b7d:	c3                   	ret    

00801b7e <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801b7e:	f3 0f 1e fb          	endbr32 
  801b82:	55                   	push   %ebp
  801b83:	89 e5                	mov    %esp,%ebp
  801b85:	53                   	push   %ebx
  801b86:	83 ec 0c             	sub    $0xc,%esp
  801b89:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801b8c:	53                   	push   %ebx
  801b8d:	6a 00                	push   $0x0
  801b8f:	e8 47 f3 ff ff       	call   800edb <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  801b94:	89 1c 24             	mov    %ebx,(%esp)
  801b97:	e8 36 f6 ff ff       	call   8011d2 <fd2data>
  801b9c:	83 c4 08             	add    $0x8,%esp
  801b9f:	50                   	push   %eax
  801ba0:	6a 00                	push   $0x0
  801ba2:	e8 34 f3 ff ff       	call   800edb <sys_page_unmap>
}
  801ba7:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801baa:	c9                   	leave  
  801bab:	c3                   	ret    

00801bac <_pipeisclosed>:
{
  801bac:	55                   	push   %ebp
  801bad:	89 e5                	mov    %esp,%ebp
  801baf:	57                   	push   %edi
  801bb0:	56                   	push   %esi
  801bb1:	53                   	push   %ebx
  801bb2:	83 ec 1c             	sub    $0x1c,%esp
  801bb5:	89 c7                	mov    %eax,%edi
  801bb7:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  801bb9:	a1 20 44 80 00       	mov    0x804420,%eax
  801bbe:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  801bc1:	83 ec 0c             	sub    $0xc,%esp
  801bc4:	57                   	push   %edi
  801bc5:	e8 73 05 00 00       	call   80213d <pageref>
  801bca:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801bcd:	89 34 24             	mov    %esi,(%esp)
  801bd0:	e8 68 05 00 00       	call   80213d <pageref>
		nn = thisenv->env_runs;
  801bd5:	8b 15 20 44 80 00    	mov    0x804420,%edx
  801bdb:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  801bde:	83 c4 10             	add    $0x10,%esp
  801be1:	39 cb                	cmp    %ecx,%ebx
  801be3:	74 1b                	je     801c00 <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  801be5:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801be8:	75 cf                	jne    801bb9 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  801bea:	8b 42 58             	mov    0x58(%edx),%eax
  801bed:	6a 01                	push   $0x1
  801bef:	50                   	push   %eax
  801bf0:	53                   	push   %ebx
  801bf1:	68 92 28 80 00       	push   $0x802892
  801bf6:	e8 38 e8 ff ff       	call   800433 <cprintf>
  801bfb:	83 c4 10             	add    $0x10,%esp
  801bfe:	eb b9                	jmp    801bb9 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  801c00:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801c03:	0f 94 c0             	sete   %al
  801c06:	0f b6 c0             	movzbl %al,%eax
}
  801c09:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c0c:	5b                   	pop    %ebx
  801c0d:	5e                   	pop    %esi
  801c0e:	5f                   	pop    %edi
  801c0f:	5d                   	pop    %ebp
  801c10:	c3                   	ret    

00801c11 <devpipe_write>:
{
  801c11:	f3 0f 1e fb          	endbr32 
  801c15:	55                   	push   %ebp
  801c16:	89 e5                	mov    %esp,%ebp
  801c18:	57                   	push   %edi
  801c19:	56                   	push   %esi
  801c1a:	53                   	push   %ebx
  801c1b:	83 ec 28             	sub    $0x28,%esp
  801c1e:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  801c21:	56                   	push   %esi
  801c22:	e8 ab f5 ff ff       	call   8011d2 <fd2data>
  801c27:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  801c29:	83 c4 10             	add    $0x10,%esp
  801c2c:	bf 00 00 00 00       	mov    $0x0,%edi
  801c31:	3b 7d 10             	cmp    0x10(%ebp),%edi
  801c34:	74 4f                	je     801c85 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  801c36:	8b 43 04             	mov    0x4(%ebx),%eax
  801c39:	8b 0b                	mov    (%ebx),%ecx
  801c3b:	8d 51 20             	lea    0x20(%ecx),%edx
  801c3e:	39 d0                	cmp    %edx,%eax
  801c40:	72 14                	jb     801c56 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  801c42:	89 da                	mov    %ebx,%edx
  801c44:	89 f0                	mov    %esi,%eax
  801c46:	e8 61 ff ff ff       	call   801bac <_pipeisclosed>
  801c4b:	85 c0                	test   %eax,%eax
  801c4d:	75 3b                	jne    801c8a <devpipe_write+0x79>
			sys_yield();
  801c4f:	e8 d7 f1 ff ff       	call   800e2b <sys_yield>
  801c54:	eb e0                	jmp    801c36 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  801c56:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801c59:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801c5d:	88 4d e7             	mov    %cl,-0x19(%ebp)
  801c60:	89 c2                	mov    %eax,%edx
  801c62:	c1 fa 1f             	sar    $0x1f,%edx
  801c65:	89 d1                	mov    %edx,%ecx
  801c67:	c1 e9 1b             	shr    $0x1b,%ecx
  801c6a:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801c6d:	83 e2 1f             	and    $0x1f,%edx
  801c70:	29 ca                	sub    %ecx,%edx
  801c72:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  801c76:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801c7a:	83 c0 01             	add    $0x1,%eax
  801c7d:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  801c80:	83 c7 01             	add    $0x1,%edi
  801c83:	eb ac                	jmp    801c31 <devpipe_write+0x20>
	return i;
  801c85:	8b 45 10             	mov    0x10(%ebp),%eax
  801c88:	eb 05                	jmp    801c8f <devpipe_write+0x7e>
				return 0;
  801c8a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801c8f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c92:	5b                   	pop    %ebx
  801c93:	5e                   	pop    %esi
  801c94:	5f                   	pop    %edi
  801c95:	5d                   	pop    %ebp
  801c96:	c3                   	ret    

00801c97 <devpipe_read>:
{
  801c97:	f3 0f 1e fb          	endbr32 
  801c9b:	55                   	push   %ebp
  801c9c:	89 e5                	mov    %esp,%ebp
  801c9e:	57                   	push   %edi
  801c9f:	56                   	push   %esi
  801ca0:	53                   	push   %ebx
  801ca1:	83 ec 18             	sub    $0x18,%esp
  801ca4:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  801ca7:	57                   	push   %edi
  801ca8:	e8 25 f5 ff ff       	call   8011d2 <fd2data>
  801cad:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  801caf:	83 c4 10             	add    $0x10,%esp
  801cb2:	be 00 00 00 00       	mov    $0x0,%esi
  801cb7:	3b 75 10             	cmp    0x10(%ebp),%esi
  801cba:	75 14                	jne    801cd0 <devpipe_read+0x39>
	return i;
  801cbc:	8b 45 10             	mov    0x10(%ebp),%eax
  801cbf:	eb 02                	jmp    801cc3 <devpipe_read+0x2c>
				return i;
  801cc1:	89 f0                	mov    %esi,%eax
}
  801cc3:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801cc6:	5b                   	pop    %ebx
  801cc7:	5e                   	pop    %esi
  801cc8:	5f                   	pop    %edi
  801cc9:	5d                   	pop    %ebp
  801cca:	c3                   	ret    
			sys_yield();
  801ccb:	e8 5b f1 ff ff       	call   800e2b <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  801cd0:	8b 03                	mov    (%ebx),%eax
  801cd2:	3b 43 04             	cmp    0x4(%ebx),%eax
  801cd5:	75 18                	jne    801cef <devpipe_read+0x58>
			if (i > 0)
  801cd7:	85 f6                	test   %esi,%esi
  801cd9:	75 e6                	jne    801cc1 <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  801cdb:	89 da                	mov    %ebx,%edx
  801cdd:	89 f8                	mov    %edi,%eax
  801cdf:	e8 c8 fe ff ff       	call   801bac <_pipeisclosed>
  801ce4:	85 c0                	test   %eax,%eax
  801ce6:	74 e3                	je     801ccb <devpipe_read+0x34>
				return 0;
  801ce8:	b8 00 00 00 00       	mov    $0x0,%eax
  801ced:	eb d4                	jmp    801cc3 <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  801cef:	99                   	cltd   
  801cf0:	c1 ea 1b             	shr    $0x1b,%edx
  801cf3:	01 d0                	add    %edx,%eax
  801cf5:	83 e0 1f             	and    $0x1f,%eax
  801cf8:	29 d0                	sub    %edx,%eax
  801cfa:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  801cff:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801d02:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  801d05:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  801d08:	83 c6 01             	add    $0x1,%esi
  801d0b:	eb aa                	jmp    801cb7 <devpipe_read+0x20>

00801d0d <pipe>:
{
  801d0d:	f3 0f 1e fb          	endbr32 
  801d11:	55                   	push   %ebp
  801d12:	89 e5                	mov    %esp,%ebp
  801d14:	56                   	push   %esi
  801d15:	53                   	push   %ebx
  801d16:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  801d19:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801d1c:	50                   	push   %eax
  801d1d:	e8 cb f4 ff ff       	call   8011ed <fd_alloc>
  801d22:	89 c3                	mov    %eax,%ebx
  801d24:	83 c4 10             	add    $0x10,%esp
  801d27:	85 c0                	test   %eax,%eax
  801d29:	0f 88 23 01 00 00    	js     801e52 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801d2f:	83 ec 04             	sub    $0x4,%esp
  801d32:	68 07 04 00 00       	push   $0x407
  801d37:	ff 75 f4             	pushl  -0xc(%ebp)
  801d3a:	6a 00                	push   $0x0
  801d3c:	e8 0d f1 ff ff       	call   800e4e <sys_page_alloc>
  801d41:	89 c3                	mov    %eax,%ebx
  801d43:	83 c4 10             	add    $0x10,%esp
  801d46:	85 c0                	test   %eax,%eax
  801d48:	0f 88 04 01 00 00    	js     801e52 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  801d4e:	83 ec 0c             	sub    $0xc,%esp
  801d51:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801d54:	50                   	push   %eax
  801d55:	e8 93 f4 ff ff       	call   8011ed <fd_alloc>
  801d5a:	89 c3                	mov    %eax,%ebx
  801d5c:	83 c4 10             	add    $0x10,%esp
  801d5f:	85 c0                	test   %eax,%eax
  801d61:	0f 88 db 00 00 00    	js     801e42 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801d67:	83 ec 04             	sub    $0x4,%esp
  801d6a:	68 07 04 00 00       	push   $0x407
  801d6f:	ff 75 f0             	pushl  -0x10(%ebp)
  801d72:	6a 00                	push   $0x0
  801d74:	e8 d5 f0 ff ff       	call   800e4e <sys_page_alloc>
  801d79:	89 c3                	mov    %eax,%ebx
  801d7b:	83 c4 10             	add    $0x10,%esp
  801d7e:	85 c0                	test   %eax,%eax
  801d80:	0f 88 bc 00 00 00    	js     801e42 <pipe+0x135>
	va = fd2data(fd0);
  801d86:	83 ec 0c             	sub    $0xc,%esp
  801d89:	ff 75 f4             	pushl  -0xc(%ebp)
  801d8c:	e8 41 f4 ff ff       	call   8011d2 <fd2data>
  801d91:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801d93:	83 c4 0c             	add    $0xc,%esp
  801d96:	68 07 04 00 00       	push   $0x407
  801d9b:	50                   	push   %eax
  801d9c:	6a 00                	push   $0x0
  801d9e:	e8 ab f0 ff ff       	call   800e4e <sys_page_alloc>
  801da3:	89 c3                	mov    %eax,%ebx
  801da5:	83 c4 10             	add    $0x10,%esp
  801da8:	85 c0                	test   %eax,%eax
  801daa:	0f 88 82 00 00 00    	js     801e32 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801db0:	83 ec 0c             	sub    $0xc,%esp
  801db3:	ff 75 f0             	pushl  -0x10(%ebp)
  801db6:	e8 17 f4 ff ff       	call   8011d2 <fd2data>
  801dbb:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  801dc2:	50                   	push   %eax
  801dc3:	6a 00                	push   $0x0
  801dc5:	56                   	push   %esi
  801dc6:	6a 00                	push   $0x0
  801dc8:	e8 c8 f0 ff ff       	call   800e95 <sys_page_map>
  801dcd:	89 c3                	mov    %eax,%ebx
  801dcf:	83 c4 20             	add    $0x20,%esp
  801dd2:	85 c0                	test   %eax,%eax
  801dd4:	78 4e                	js     801e24 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  801dd6:	a1 20 30 80 00       	mov    0x803020,%eax
  801ddb:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801dde:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  801de0:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801de3:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  801dea:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801ded:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  801def:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801df2:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  801df9:	83 ec 0c             	sub    $0xc,%esp
  801dfc:	ff 75 f4             	pushl  -0xc(%ebp)
  801dff:	e8 ba f3 ff ff       	call   8011be <fd2num>
  801e04:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801e07:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  801e09:	83 c4 04             	add    $0x4,%esp
  801e0c:	ff 75 f0             	pushl  -0x10(%ebp)
  801e0f:	e8 aa f3 ff ff       	call   8011be <fd2num>
  801e14:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801e17:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  801e1a:	83 c4 10             	add    $0x10,%esp
  801e1d:	bb 00 00 00 00       	mov    $0x0,%ebx
  801e22:	eb 2e                	jmp    801e52 <pipe+0x145>
	sys_page_unmap(0, va);
  801e24:	83 ec 08             	sub    $0x8,%esp
  801e27:	56                   	push   %esi
  801e28:	6a 00                	push   $0x0
  801e2a:	e8 ac f0 ff ff       	call   800edb <sys_page_unmap>
  801e2f:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  801e32:	83 ec 08             	sub    $0x8,%esp
  801e35:	ff 75 f0             	pushl  -0x10(%ebp)
  801e38:	6a 00                	push   $0x0
  801e3a:	e8 9c f0 ff ff       	call   800edb <sys_page_unmap>
  801e3f:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  801e42:	83 ec 08             	sub    $0x8,%esp
  801e45:	ff 75 f4             	pushl  -0xc(%ebp)
  801e48:	6a 00                	push   $0x0
  801e4a:	e8 8c f0 ff ff       	call   800edb <sys_page_unmap>
  801e4f:	83 c4 10             	add    $0x10,%esp
}
  801e52:	89 d8                	mov    %ebx,%eax
  801e54:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801e57:	5b                   	pop    %ebx
  801e58:	5e                   	pop    %esi
  801e59:	5d                   	pop    %ebp
  801e5a:	c3                   	ret    

00801e5b <pipeisclosed>:
{
  801e5b:	f3 0f 1e fb          	endbr32 
  801e5f:	55                   	push   %ebp
  801e60:	89 e5                	mov    %esp,%ebp
  801e62:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801e65:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801e68:	50                   	push   %eax
  801e69:	ff 75 08             	pushl  0x8(%ebp)
  801e6c:	e8 d2 f3 ff ff       	call   801243 <fd_lookup>
  801e71:	83 c4 10             	add    $0x10,%esp
  801e74:	85 c0                	test   %eax,%eax
  801e76:	78 18                	js     801e90 <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801e78:	83 ec 0c             	sub    $0xc,%esp
  801e7b:	ff 75 f4             	pushl  -0xc(%ebp)
  801e7e:	e8 4f f3 ff ff       	call   8011d2 <fd2data>
  801e83:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801e85:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801e88:	e8 1f fd ff ff       	call   801bac <_pipeisclosed>
  801e8d:	83 c4 10             	add    $0x10,%esp
}
  801e90:	c9                   	leave  
  801e91:	c3                   	ret    

00801e92 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  801e92:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801e96:	b8 00 00 00 00       	mov    $0x0,%eax
  801e9b:	c3                   	ret    

00801e9c <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801e9c:	f3 0f 1e fb          	endbr32 
  801ea0:	55                   	push   %ebp
  801ea1:	89 e5                	mov    %esp,%ebp
  801ea3:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801ea6:	68 aa 28 80 00       	push   $0x8028aa
  801eab:	ff 75 0c             	pushl  0xc(%ebp)
  801eae:	e8 59 eb ff ff       	call   800a0c <strcpy>
	return 0;
}
  801eb3:	b8 00 00 00 00       	mov    $0x0,%eax
  801eb8:	c9                   	leave  
  801eb9:	c3                   	ret    

00801eba <devcons_write>:
{
  801eba:	f3 0f 1e fb          	endbr32 
  801ebe:	55                   	push   %ebp
  801ebf:	89 e5                	mov    %esp,%ebp
  801ec1:	57                   	push   %edi
  801ec2:	56                   	push   %esi
  801ec3:	53                   	push   %ebx
  801ec4:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801eca:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  801ecf:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  801ed5:	3b 75 10             	cmp    0x10(%ebp),%esi
  801ed8:	73 31                	jae    801f0b <devcons_write+0x51>
		m = n - tot;
  801eda:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801edd:	29 f3                	sub    %esi,%ebx
  801edf:	83 fb 7f             	cmp    $0x7f,%ebx
  801ee2:	b8 7f 00 00 00       	mov    $0x7f,%eax
  801ee7:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  801eea:	83 ec 04             	sub    $0x4,%esp
  801eed:	53                   	push   %ebx
  801eee:	89 f0                	mov    %esi,%eax
  801ef0:	03 45 0c             	add    0xc(%ebp),%eax
  801ef3:	50                   	push   %eax
  801ef4:	57                   	push   %edi
  801ef5:	e8 c8 ec ff ff       	call   800bc2 <memmove>
		sys_cputs(buf, m);
  801efa:	83 c4 08             	add    $0x8,%esp
  801efd:	53                   	push   %ebx
  801efe:	57                   	push   %edi
  801eff:	e8 7a ee ff ff       	call   800d7e <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  801f04:	01 de                	add    %ebx,%esi
  801f06:	83 c4 10             	add    $0x10,%esp
  801f09:	eb ca                	jmp    801ed5 <devcons_write+0x1b>
}
  801f0b:	89 f0                	mov    %esi,%eax
  801f0d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801f10:	5b                   	pop    %ebx
  801f11:	5e                   	pop    %esi
  801f12:	5f                   	pop    %edi
  801f13:	5d                   	pop    %ebp
  801f14:	c3                   	ret    

00801f15 <devcons_read>:
{
  801f15:	f3 0f 1e fb          	endbr32 
  801f19:	55                   	push   %ebp
  801f1a:	89 e5                	mov    %esp,%ebp
  801f1c:	83 ec 08             	sub    $0x8,%esp
  801f1f:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  801f24:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  801f28:	74 21                	je     801f4b <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  801f2a:	e8 71 ee ff ff       	call   800da0 <sys_cgetc>
  801f2f:	85 c0                	test   %eax,%eax
  801f31:	75 07                	jne    801f3a <devcons_read+0x25>
		sys_yield();
  801f33:	e8 f3 ee ff ff       	call   800e2b <sys_yield>
  801f38:	eb f0                	jmp    801f2a <devcons_read+0x15>
	if (c < 0)
  801f3a:	78 0f                	js     801f4b <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  801f3c:	83 f8 04             	cmp    $0x4,%eax
  801f3f:	74 0c                	je     801f4d <devcons_read+0x38>
	*(char*)vbuf = c;
  801f41:	8b 55 0c             	mov    0xc(%ebp),%edx
  801f44:	88 02                	mov    %al,(%edx)
	return 1;
  801f46:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801f4b:	c9                   	leave  
  801f4c:	c3                   	ret    
		return 0;
  801f4d:	b8 00 00 00 00       	mov    $0x0,%eax
  801f52:	eb f7                	jmp    801f4b <devcons_read+0x36>

00801f54 <cputchar>:
{
  801f54:	f3 0f 1e fb          	endbr32 
  801f58:	55                   	push   %ebp
  801f59:	89 e5                	mov    %esp,%ebp
  801f5b:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801f5e:	8b 45 08             	mov    0x8(%ebp),%eax
  801f61:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801f64:	6a 01                	push   $0x1
  801f66:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801f69:	50                   	push   %eax
  801f6a:	e8 0f ee ff ff       	call   800d7e <sys_cputs>
}
  801f6f:	83 c4 10             	add    $0x10,%esp
  801f72:	c9                   	leave  
  801f73:	c3                   	ret    

00801f74 <getchar>:
{
  801f74:	f3 0f 1e fb          	endbr32 
  801f78:	55                   	push   %ebp
  801f79:	89 e5                	mov    %esp,%ebp
  801f7b:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801f7e:	6a 01                	push   $0x1
  801f80:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801f83:	50                   	push   %eax
  801f84:	6a 00                	push   $0x0
  801f86:	e8 3b f5 ff ff       	call   8014c6 <read>
	if (r < 0)
  801f8b:	83 c4 10             	add    $0x10,%esp
  801f8e:	85 c0                	test   %eax,%eax
  801f90:	78 06                	js     801f98 <getchar+0x24>
	if (r < 1)
  801f92:	74 06                	je     801f9a <getchar+0x26>
	return c;
  801f94:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801f98:	c9                   	leave  
  801f99:	c3                   	ret    
		return -E_EOF;
  801f9a:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801f9f:	eb f7                	jmp    801f98 <getchar+0x24>

00801fa1 <iscons>:
{
  801fa1:	f3 0f 1e fb          	endbr32 
  801fa5:	55                   	push   %ebp
  801fa6:	89 e5                	mov    %esp,%ebp
  801fa8:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801fab:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801fae:	50                   	push   %eax
  801faf:	ff 75 08             	pushl  0x8(%ebp)
  801fb2:	e8 8c f2 ff ff       	call   801243 <fd_lookup>
  801fb7:	83 c4 10             	add    $0x10,%esp
  801fba:	85 c0                	test   %eax,%eax
  801fbc:	78 11                	js     801fcf <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801fbe:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801fc1:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801fc7:	39 10                	cmp    %edx,(%eax)
  801fc9:	0f 94 c0             	sete   %al
  801fcc:	0f b6 c0             	movzbl %al,%eax
}
  801fcf:	c9                   	leave  
  801fd0:	c3                   	ret    

00801fd1 <opencons>:
{
  801fd1:	f3 0f 1e fb          	endbr32 
  801fd5:	55                   	push   %ebp
  801fd6:	89 e5                	mov    %esp,%ebp
  801fd8:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801fdb:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801fde:	50                   	push   %eax
  801fdf:	e8 09 f2 ff ff       	call   8011ed <fd_alloc>
  801fe4:	83 c4 10             	add    $0x10,%esp
  801fe7:	85 c0                	test   %eax,%eax
  801fe9:	78 3a                	js     802025 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801feb:	83 ec 04             	sub    $0x4,%esp
  801fee:	68 07 04 00 00       	push   $0x407
  801ff3:	ff 75 f4             	pushl  -0xc(%ebp)
  801ff6:	6a 00                	push   $0x0
  801ff8:	e8 51 ee ff ff       	call   800e4e <sys_page_alloc>
  801ffd:	83 c4 10             	add    $0x10,%esp
  802000:	85 c0                	test   %eax,%eax
  802002:	78 21                	js     802025 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  802004:	8b 45 f4             	mov    -0xc(%ebp),%eax
  802007:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  80200d:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  80200f:	8b 45 f4             	mov    -0xc(%ebp),%eax
  802012:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  802019:	83 ec 0c             	sub    $0xc,%esp
  80201c:	50                   	push   %eax
  80201d:	e8 9c f1 ff ff       	call   8011be <fd2num>
  802022:	83 c4 10             	add    $0x10,%esp
}
  802025:	c9                   	leave  
  802026:	c3                   	ret    

00802027 <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  802027:	f3 0f 1e fb          	endbr32 
  80202b:	55                   	push   %ebp
  80202c:	89 e5                	mov    %esp,%ebp
  80202e:	56                   	push   %esi
  80202f:	53                   	push   %ebx
  802030:	8b 75 08             	mov    0x8(%ebp),%esi
  802033:	8b 45 0c             	mov    0xc(%ebp),%eax
  802036:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  802039:	85 c0                	test   %eax,%eax
  80203b:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  802040:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  802043:	83 ec 0c             	sub    $0xc,%esp
  802046:	50                   	push   %eax
  802047:	e8 ce ef ff ff       	call   80101a <sys_ipc_recv>
  80204c:	83 c4 10             	add    $0x10,%esp
  80204f:	85 c0                	test   %eax,%eax
  802051:	78 3f                	js     802092 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  802053:	e8 b0 ed ff ff       	call   800e08 <sys_getenvid>
  802058:	25 ff 03 00 00       	and    $0x3ff,%eax
  80205d:	6b d0 7c             	imul   $0x7c,%eax,%edx
  802060:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  802066:	89 15 20 44 80 00    	mov    %edx,0x804420

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  80206c:	85 f6                	test   %esi,%esi
  80206e:	74 05                	je     802075 <ipc_recv+0x4e>
  802070:	8b 42 74             	mov    0x74(%edx),%eax
  802073:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  802075:	85 db                	test   %ebx,%ebx
  802077:	74 0a                	je     802083 <ipc_recv+0x5c>
  802079:	a1 20 44 80 00       	mov    0x804420,%eax
  80207e:	8b 40 78             	mov    0x78(%eax),%eax
  802081:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  802083:	a1 20 44 80 00       	mov    0x804420,%eax
  802088:	8b 40 70             	mov    0x70(%eax),%eax
}
  80208b:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80208e:	5b                   	pop    %ebx
  80208f:	5e                   	pop    %esi
  802090:	5d                   	pop    %ebp
  802091:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  802092:	85 f6                	test   %esi,%esi
  802094:	74 06                	je     80209c <ipc_recv+0x75>
  802096:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  80209c:	85 db                	test   %ebx,%ebx
  80209e:	74 eb                	je     80208b <ipc_recv+0x64>
  8020a0:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  8020a6:	eb e3                	jmp    80208b <ipc_recv+0x64>

008020a8 <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  8020a8:	f3 0f 1e fb          	endbr32 
  8020ac:	55                   	push   %ebp
  8020ad:	89 e5                	mov    %esp,%ebp
  8020af:	57                   	push   %edi
  8020b0:	56                   	push   %esi
  8020b1:	53                   	push   %ebx
  8020b2:	83 ec 0c             	sub    $0xc,%esp
  8020b5:	8b 7d 08             	mov    0x8(%ebp),%edi
  8020b8:	8b 75 0c             	mov    0xc(%ebp),%esi
  8020bb:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  8020be:	85 db                	test   %ebx,%ebx
  8020c0:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  8020c5:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  8020c8:	ff 75 14             	pushl  0x14(%ebp)
  8020cb:	53                   	push   %ebx
  8020cc:	56                   	push   %esi
  8020cd:	57                   	push   %edi
  8020ce:	e8 20 ef ff ff       	call   800ff3 <sys_ipc_try_send>
  8020d3:	83 c4 10             	add    $0x10,%esp
  8020d6:	85 c0                	test   %eax,%eax
  8020d8:	79 1e                	jns    8020f8 <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  8020da:	83 f8 f9             	cmp    $0xfffffff9,%eax
  8020dd:	75 07                	jne    8020e6 <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  8020df:	e8 47 ed ff ff       	call   800e2b <sys_yield>
  8020e4:	eb e2                	jmp    8020c8 <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  8020e6:	50                   	push   %eax
  8020e7:	68 b6 28 80 00       	push   $0x8028b6
  8020ec:	6a 3b                	push   $0x3b
  8020ee:	68 ca 28 80 00       	push   $0x8028ca
  8020f3:	e8 54 e2 ff ff       	call   80034c <_panic>
	}
}
  8020f8:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8020fb:	5b                   	pop    %ebx
  8020fc:	5e                   	pop    %esi
  8020fd:	5f                   	pop    %edi
  8020fe:	5d                   	pop    %ebp
  8020ff:	c3                   	ret    

00802100 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  802100:	f3 0f 1e fb          	endbr32 
  802104:	55                   	push   %ebp
  802105:	89 e5                	mov    %esp,%ebp
  802107:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  80210a:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  80210f:	6b d0 7c             	imul   $0x7c,%eax,%edx
  802112:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  802118:	8b 52 50             	mov    0x50(%edx),%edx
  80211b:	39 ca                	cmp    %ecx,%edx
  80211d:	74 11                	je     802130 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  80211f:	83 c0 01             	add    $0x1,%eax
  802122:	3d 00 04 00 00       	cmp    $0x400,%eax
  802127:	75 e6                	jne    80210f <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  802129:	b8 00 00 00 00       	mov    $0x0,%eax
  80212e:	eb 0b                	jmp    80213b <ipc_find_env+0x3b>
			return envs[i].env_id;
  802130:	6b c0 7c             	imul   $0x7c,%eax,%eax
  802133:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  802138:	8b 40 48             	mov    0x48(%eax),%eax
}
  80213b:	5d                   	pop    %ebp
  80213c:	c3                   	ret    

0080213d <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  80213d:	f3 0f 1e fb          	endbr32 
  802141:	55                   	push   %ebp
  802142:	89 e5                	mov    %esp,%ebp
  802144:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  802147:	89 c2                	mov    %eax,%edx
  802149:	c1 ea 16             	shr    $0x16,%edx
  80214c:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  802153:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  802158:	f6 c1 01             	test   $0x1,%cl
  80215b:	74 1c                	je     802179 <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  80215d:	c1 e8 0c             	shr    $0xc,%eax
  802160:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  802167:	a8 01                	test   $0x1,%al
  802169:	74 0e                	je     802179 <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  80216b:	c1 e8 0c             	shr    $0xc,%eax
  80216e:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  802175:	ef 
  802176:	0f b7 d2             	movzwl %dx,%edx
}
  802179:	89 d0                	mov    %edx,%eax
  80217b:	5d                   	pop    %ebp
  80217c:	c3                   	ret    
  80217d:	66 90                	xchg   %ax,%ax
  80217f:	90                   	nop

00802180 <__udivdi3>:
  802180:	f3 0f 1e fb          	endbr32 
  802184:	55                   	push   %ebp
  802185:	57                   	push   %edi
  802186:	56                   	push   %esi
  802187:	53                   	push   %ebx
  802188:	83 ec 1c             	sub    $0x1c,%esp
  80218b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  80218f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  802193:	8b 74 24 34          	mov    0x34(%esp),%esi
  802197:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  80219b:	85 d2                	test   %edx,%edx
  80219d:	75 19                	jne    8021b8 <__udivdi3+0x38>
  80219f:	39 f3                	cmp    %esi,%ebx
  8021a1:	76 4d                	jbe    8021f0 <__udivdi3+0x70>
  8021a3:	31 ff                	xor    %edi,%edi
  8021a5:	89 e8                	mov    %ebp,%eax
  8021a7:	89 f2                	mov    %esi,%edx
  8021a9:	f7 f3                	div    %ebx
  8021ab:	89 fa                	mov    %edi,%edx
  8021ad:	83 c4 1c             	add    $0x1c,%esp
  8021b0:	5b                   	pop    %ebx
  8021b1:	5e                   	pop    %esi
  8021b2:	5f                   	pop    %edi
  8021b3:	5d                   	pop    %ebp
  8021b4:	c3                   	ret    
  8021b5:	8d 76 00             	lea    0x0(%esi),%esi
  8021b8:	39 f2                	cmp    %esi,%edx
  8021ba:	76 14                	jbe    8021d0 <__udivdi3+0x50>
  8021bc:	31 ff                	xor    %edi,%edi
  8021be:	31 c0                	xor    %eax,%eax
  8021c0:	89 fa                	mov    %edi,%edx
  8021c2:	83 c4 1c             	add    $0x1c,%esp
  8021c5:	5b                   	pop    %ebx
  8021c6:	5e                   	pop    %esi
  8021c7:	5f                   	pop    %edi
  8021c8:	5d                   	pop    %ebp
  8021c9:	c3                   	ret    
  8021ca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  8021d0:	0f bd fa             	bsr    %edx,%edi
  8021d3:	83 f7 1f             	xor    $0x1f,%edi
  8021d6:	75 48                	jne    802220 <__udivdi3+0xa0>
  8021d8:	39 f2                	cmp    %esi,%edx
  8021da:	72 06                	jb     8021e2 <__udivdi3+0x62>
  8021dc:	31 c0                	xor    %eax,%eax
  8021de:	39 eb                	cmp    %ebp,%ebx
  8021e0:	77 de                	ja     8021c0 <__udivdi3+0x40>
  8021e2:	b8 01 00 00 00       	mov    $0x1,%eax
  8021e7:	eb d7                	jmp    8021c0 <__udivdi3+0x40>
  8021e9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8021f0:	89 d9                	mov    %ebx,%ecx
  8021f2:	85 db                	test   %ebx,%ebx
  8021f4:	75 0b                	jne    802201 <__udivdi3+0x81>
  8021f6:	b8 01 00 00 00       	mov    $0x1,%eax
  8021fb:	31 d2                	xor    %edx,%edx
  8021fd:	f7 f3                	div    %ebx
  8021ff:	89 c1                	mov    %eax,%ecx
  802201:	31 d2                	xor    %edx,%edx
  802203:	89 f0                	mov    %esi,%eax
  802205:	f7 f1                	div    %ecx
  802207:	89 c6                	mov    %eax,%esi
  802209:	89 e8                	mov    %ebp,%eax
  80220b:	89 f7                	mov    %esi,%edi
  80220d:	f7 f1                	div    %ecx
  80220f:	89 fa                	mov    %edi,%edx
  802211:	83 c4 1c             	add    $0x1c,%esp
  802214:	5b                   	pop    %ebx
  802215:	5e                   	pop    %esi
  802216:	5f                   	pop    %edi
  802217:	5d                   	pop    %ebp
  802218:	c3                   	ret    
  802219:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  802220:	89 f9                	mov    %edi,%ecx
  802222:	b8 20 00 00 00       	mov    $0x20,%eax
  802227:	29 f8                	sub    %edi,%eax
  802229:	d3 e2                	shl    %cl,%edx
  80222b:	89 54 24 08          	mov    %edx,0x8(%esp)
  80222f:	89 c1                	mov    %eax,%ecx
  802231:	89 da                	mov    %ebx,%edx
  802233:	d3 ea                	shr    %cl,%edx
  802235:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  802239:	09 d1                	or     %edx,%ecx
  80223b:	89 f2                	mov    %esi,%edx
  80223d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  802241:	89 f9                	mov    %edi,%ecx
  802243:	d3 e3                	shl    %cl,%ebx
  802245:	89 c1                	mov    %eax,%ecx
  802247:	d3 ea                	shr    %cl,%edx
  802249:	89 f9                	mov    %edi,%ecx
  80224b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  80224f:	89 eb                	mov    %ebp,%ebx
  802251:	d3 e6                	shl    %cl,%esi
  802253:	89 c1                	mov    %eax,%ecx
  802255:	d3 eb                	shr    %cl,%ebx
  802257:	09 de                	or     %ebx,%esi
  802259:	89 f0                	mov    %esi,%eax
  80225b:	f7 74 24 08          	divl   0x8(%esp)
  80225f:	89 d6                	mov    %edx,%esi
  802261:	89 c3                	mov    %eax,%ebx
  802263:	f7 64 24 0c          	mull   0xc(%esp)
  802267:	39 d6                	cmp    %edx,%esi
  802269:	72 15                	jb     802280 <__udivdi3+0x100>
  80226b:	89 f9                	mov    %edi,%ecx
  80226d:	d3 e5                	shl    %cl,%ebp
  80226f:	39 c5                	cmp    %eax,%ebp
  802271:	73 04                	jae    802277 <__udivdi3+0xf7>
  802273:	39 d6                	cmp    %edx,%esi
  802275:	74 09                	je     802280 <__udivdi3+0x100>
  802277:	89 d8                	mov    %ebx,%eax
  802279:	31 ff                	xor    %edi,%edi
  80227b:	e9 40 ff ff ff       	jmp    8021c0 <__udivdi3+0x40>
  802280:	8d 43 ff             	lea    -0x1(%ebx),%eax
  802283:	31 ff                	xor    %edi,%edi
  802285:	e9 36 ff ff ff       	jmp    8021c0 <__udivdi3+0x40>
  80228a:	66 90                	xchg   %ax,%ax
  80228c:	66 90                	xchg   %ax,%ax
  80228e:	66 90                	xchg   %ax,%ax

00802290 <__umoddi3>:
  802290:	f3 0f 1e fb          	endbr32 
  802294:	55                   	push   %ebp
  802295:	57                   	push   %edi
  802296:	56                   	push   %esi
  802297:	53                   	push   %ebx
  802298:	83 ec 1c             	sub    $0x1c,%esp
  80229b:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  80229f:	8b 74 24 30          	mov    0x30(%esp),%esi
  8022a3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  8022a7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  8022ab:	85 c0                	test   %eax,%eax
  8022ad:	75 19                	jne    8022c8 <__umoddi3+0x38>
  8022af:	39 df                	cmp    %ebx,%edi
  8022b1:	76 5d                	jbe    802310 <__umoddi3+0x80>
  8022b3:	89 f0                	mov    %esi,%eax
  8022b5:	89 da                	mov    %ebx,%edx
  8022b7:	f7 f7                	div    %edi
  8022b9:	89 d0                	mov    %edx,%eax
  8022bb:	31 d2                	xor    %edx,%edx
  8022bd:	83 c4 1c             	add    $0x1c,%esp
  8022c0:	5b                   	pop    %ebx
  8022c1:	5e                   	pop    %esi
  8022c2:	5f                   	pop    %edi
  8022c3:	5d                   	pop    %ebp
  8022c4:	c3                   	ret    
  8022c5:	8d 76 00             	lea    0x0(%esi),%esi
  8022c8:	89 f2                	mov    %esi,%edx
  8022ca:	39 d8                	cmp    %ebx,%eax
  8022cc:	76 12                	jbe    8022e0 <__umoddi3+0x50>
  8022ce:	89 f0                	mov    %esi,%eax
  8022d0:	89 da                	mov    %ebx,%edx
  8022d2:	83 c4 1c             	add    $0x1c,%esp
  8022d5:	5b                   	pop    %ebx
  8022d6:	5e                   	pop    %esi
  8022d7:	5f                   	pop    %edi
  8022d8:	5d                   	pop    %ebp
  8022d9:	c3                   	ret    
  8022da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  8022e0:	0f bd e8             	bsr    %eax,%ebp
  8022e3:	83 f5 1f             	xor    $0x1f,%ebp
  8022e6:	75 50                	jne    802338 <__umoddi3+0xa8>
  8022e8:	39 d8                	cmp    %ebx,%eax
  8022ea:	0f 82 e0 00 00 00    	jb     8023d0 <__umoddi3+0x140>
  8022f0:	89 d9                	mov    %ebx,%ecx
  8022f2:	39 f7                	cmp    %esi,%edi
  8022f4:	0f 86 d6 00 00 00    	jbe    8023d0 <__umoddi3+0x140>
  8022fa:	89 d0                	mov    %edx,%eax
  8022fc:	89 ca                	mov    %ecx,%edx
  8022fe:	83 c4 1c             	add    $0x1c,%esp
  802301:	5b                   	pop    %ebx
  802302:	5e                   	pop    %esi
  802303:	5f                   	pop    %edi
  802304:	5d                   	pop    %ebp
  802305:	c3                   	ret    
  802306:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  80230d:	8d 76 00             	lea    0x0(%esi),%esi
  802310:	89 fd                	mov    %edi,%ebp
  802312:	85 ff                	test   %edi,%edi
  802314:	75 0b                	jne    802321 <__umoddi3+0x91>
  802316:	b8 01 00 00 00       	mov    $0x1,%eax
  80231b:	31 d2                	xor    %edx,%edx
  80231d:	f7 f7                	div    %edi
  80231f:	89 c5                	mov    %eax,%ebp
  802321:	89 d8                	mov    %ebx,%eax
  802323:	31 d2                	xor    %edx,%edx
  802325:	f7 f5                	div    %ebp
  802327:	89 f0                	mov    %esi,%eax
  802329:	f7 f5                	div    %ebp
  80232b:	89 d0                	mov    %edx,%eax
  80232d:	31 d2                	xor    %edx,%edx
  80232f:	eb 8c                	jmp    8022bd <__umoddi3+0x2d>
  802331:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  802338:	89 e9                	mov    %ebp,%ecx
  80233a:	ba 20 00 00 00       	mov    $0x20,%edx
  80233f:	29 ea                	sub    %ebp,%edx
  802341:	d3 e0                	shl    %cl,%eax
  802343:	89 44 24 08          	mov    %eax,0x8(%esp)
  802347:	89 d1                	mov    %edx,%ecx
  802349:	89 f8                	mov    %edi,%eax
  80234b:	d3 e8                	shr    %cl,%eax
  80234d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  802351:	89 54 24 04          	mov    %edx,0x4(%esp)
  802355:	8b 54 24 04          	mov    0x4(%esp),%edx
  802359:	09 c1                	or     %eax,%ecx
  80235b:	89 d8                	mov    %ebx,%eax
  80235d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  802361:	89 e9                	mov    %ebp,%ecx
  802363:	d3 e7                	shl    %cl,%edi
  802365:	89 d1                	mov    %edx,%ecx
  802367:	d3 e8                	shr    %cl,%eax
  802369:	89 e9                	mov    %ebp,%ecx
  80236b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  80236f:	d3 e3                	shl    %cl,%ebx
  802371:	89 c7                	mov    %eax,%edi
  802373:	89 d1                	mov    %edx,%ecx
  802375:	89 f0                	mov    %esi,%eax
  802377:	d3 e8                	shr    %cl,%eax
  802379:	89 e9                	mov    %ebp,%ecx
  80237b:	89 fa                	mov    %edi,%edx
  80237d:	d3 e6                	shl    %cl,%esi
  80237f:	09 d8                	or     %ebx,%eax
  802381:	f7 74 24 08          	divl   0x8(%esp)
  802385:	89 d1                	mov    %edx,%ecx
  802387:	89 f3                	mov    %esi,%ebx
  802389:	f7 64 24 0c          	mull   0xc(%esp)
  80238d:	89 c6                	mov    %eax,%esi
  80238f:	89 d7                	mov    %edx,%edi
  802391:	39 d1                	cmp    %edx,%ecx
  802393:	72 06                	jb     80239b <__umoddi3+0x10b>
  802395:	75 10                	jne    8023a7 <__umoddi3+0x117>
  802397:	39 c3                	cmp    %eax,%ebx
  802399:	73 0c                	jae    8023a7 <__umoddi3+0x117>
  80239b:	2b 44 24 0c          	sub    0xc(%esp),%eax
  80239f:	1b 54 24 08          	sbb    0x8(%esp),%edx
  8023a3:	89 d7                	mov    %edx,%edi
  8023a5:	89 c6                	mov    %eax,%esi
  8023a7:	89 ca                	mov    %ecx,%edx
  8023a9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  8023ae:	29 f3                	sub    %esi,%ebx
  8023b0:	19 fa                	sbb    %edi,%edx
  8023b2:	89 d0                	mov    %edx,%eax
  8023b4:	d3 e0                	shl    %cl,%eax
  8023b6:	89 e9                	mov    %ebp,%ecx
  8023b8:	d3 eb                	shr    %cl,%ebx
  8023ba:	d3 ea                	shr    %cl,%edx
  8023bc:	09 d8                	or     %ebx,%eax
  8023be:	83 c4 1c             	add    $0x1c,%esp
  8023c1:	5b                   	pop    %ebx
  8023c2:	5e                   	pop    %esi
  8023c3:	5f                   	pop    %edi
  8023c4:	5d                   	pop    %ebp
  8023c5:	c3                   	ret    
  8023c6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  8023cd:	8d 76 00             	lea    0x0(%esi),%esi
  8023d0:	29 fe                	sub    %edi,%esi
  8023d2:	19 c3                	sbb    %eax,%ebx
  8023d4:	89 f2                	mov    %esi,%edx
  8023d6:	89 d9                	mov    %ebx,%ecx
  8023d8:	e9 1d ff ff ff       	jmp    8022fa <__umoddi3+0x6a>
